【问题标题】:I want to display text which file choose by user using css我想显示用户使用 css 选择的文件的文本
【发布时间】:2016-07-27 20:01:38
【问题描述】:

我在css下面使用了这个

.fileContainer [type=file] {
    cursor: inherit;
    display: block;
    font-size: 999px;
    filter: alpha(opacity=0);
    min-height: 100%;
    min-width: 100%;
    opacity: 0;
    position: absolute;
    right: 0;
    text-align: right;
    top: 0;
}

对于我的 html

<div class=" btn btn-primary fileContainer">
   <div class="input-group">
      <i class="fa fa-paperclip fa-inverse"></i> Attachment
      <input type="file" ngf-select ngf-multiple="true" 
      ng-model="noteListData.files" name="files">
      </i>
   </div>
</div>

使用这个 css 我看不到那个文本。 帮帮我。 我也想显示按钮和文本。

谢谢

【问题讨论】:

  • 你看不到什么文字?

标签: html css twitter-bootstrap


【解决方案1】:

原来应该是属性“不透明度”而不是“过滤器”。尝试将“不透明度”设置为 1。

【讨论】:

  • 对了,我个人推荐这个好用的jQuery插件:plugins.krajee.com/file-input/demo
  • 我试图复制您的代码并粘贴到一个新的 html 文件中,在我将不透明度设置为 1 后,它确实有效。是不是因为你把 font-size 设置为 999px,而且字体太大,让你几乎看不到它?
  • 你能上传 plunker 或 jsfiddle 吗?
猜你喜欢
  • 1970-01-01
  • 2021-07-23
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-06-09
  • 1970-01-01
  • 2016-06-19
  • 1970-01-01
相关资源
最近更新 更多