无法在旁边的bootstrap中输入文件

时间:2016-08-22 05:07:37

标签: html html5 twitter-bootstrap

我尝试在旁边的bootstrap中创建输入文件,但是当我单击按钮以附加文件时,弹出浏览文件无法正常工作。你知道这是什么问题吗?

<aside id="sidebar-right" class="sidebar-right">
<div class="form-group">
  <label class="col-md-3 control-label">File Upload</label>
  <div class="col-md-6">
    <div class="fileupload fileupload-new" data-provides="fileupload">
      <div class="input-append">
        <div class="uneditable-input">
          <i class="fa fa-file fileupload-exists"></i>
          <span class="fileupload-preview"></span>
        </div>
        <span class="btn btn-default btn-file">
          <span class="fileupload-exists">Change</span>
          <span class="fileupload-new">Select file</span>
          <input type="file" />
        </span>
        <a href="#" class="btn btn-default fileupload-exists" data-dismiss="fileupload">Remove</a>
      </div>
    </div>
  </div>
</div>

2 个答案:

答案 0 :(得分:0)

你在哪里关闭标签?关闭它然后再试一次。

答案 1 :(得分:0)

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<aside id="sidebar-right" class="sidebar-right">
<div class="form-group">
  <label class="col-md-3 control-label">File Upload</label>
  <div class="col-md-6">
    <div class="fileupload fileupload-new" data-provides="fileupload">
      <div class="input-append">
        <div class="uneditable-input">
          <i class="fa fa-file fileupload-exists"></i>
          <span class="fileupload-preview"></span>
        </div>
        <span class="btn btn-default btn-file">
          <span class="fileupload-exists">Change</span>
          <span class="fileupload-new">Select file</span>
          <input type="file" />
        </span>
        <a href="#" class="btn btn-default fileupload-exists" data-dismiss="fileupload">Remove</a>
      </div>
    </div>
  </div>
</div>
</aside>

</body>
</html>

使用相同的代码正常工作,如前面的答案所述。 https://jsfiddle.net/14Lfb7kh/