如何在文件输入中将样式应用于按钮

时间:2018-06-05 11:52:09

标签: html css alignment

我试图在MAC代码中使用文件输入,对齐看起来很糟糕。在所有剩余的,它看起来很好。当我尝试将样式应用于文本(没有选择文件)时,我无法将样式应用于唯一按钮(选择文件)。

在MAC中:

enter image description here

在其他笔记本电脑中:

enter image description here

CSS:

input[type=file]::-webkit-file-upload-button {
    cursor: pointer;
    margin-bottom: 2px;
}

1 个答案:

答案 0 :(得分:0)

    <label for="pickerId">
       Your custom picker viewable item to be added here and style to be applied to this label. The real input will be hidden but clicking here will be enough to trigger file picker
    </label>
    <input id="pickerId" style="display:none;" type="file"/>

相关问题