Materializecss文件输入按钮向右

问题描述 投票:-1回答:1

我想在materializecss中使用文件输入。来自网站的模板在左侧位置添加按钮,然后在右侧位置https://www.tutorialspoint.com/materialize/materialize_file.htm添加文本框。

我想交换这些项目的位置-文本框,然后是按钮。可以更改吗?

css materialize
1个回答
1
投票

您要做的就是根据您的要求检查和更改内容。

HTML

<div class = "row">
  <div class = "file-field input-field">
    <div class = "btn">
      <span>Browse</span>
      <input type = "file" multiple />
    </div>

    <div class = "file-path-wrapper">
      <input class = "file-path validate" type = "text"
             placeholder = "Upload multiple files" />
    </div>
  </div>    
</div>

CSS

.file-field{
  display: flex !important;
  flex-direction: row-reverse !important;
}

.file-path-wrapper{
  width: 100%;
}

Codepen - Demo

© www.soinside.com 2019 - 2024. All rights reserved.