【问题标题】:Change input width for file upload if empty image CSS如果为空图像 CSS,则更改文件上传的输入宽度
【发布时间】:2014-08-18 22:15:21
【问题描述】:

如果图像尚未上传,我想增大输入[type=file] 的宽度。这是我一直在尝试的:

input[type=file] img[src=""] {
width: 300px;
}

input[type=file] 和 img[src=""] 单独工作时可以工作,但我无法让它们一起工作。

【问题讨论】:

  • 我不确定你到底想要什么,但听起来这可能是你想要在服务器端处理的事情。
  • 不,使用 CSS。如果还没有上传图片,尝试放大可以点击上传图片的区域。
  • 也许见this link

标签: css image input width


【解决方案1】:

请尝试以下代码:

input[type="file"] {
  border: 1px solid #ccc;
  border-radius: 4px;
  width: 300px;
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-08-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-02-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多