<分区>
我目前正在开发一个上传文件的按钮,但我不想使用默认输入[type=file]
这是我的片段:
%button.btn
Upload your own
%input{ :type => "file", :class => 'file-input' }
这是CSS:
left: -34; // to align it with the button
top: -23;
position: relative;
opacity: 0;
目前它有效,我只是不确定标记。推特在尝试上传个人资料照片时也具有相同的结构。
最佳答案
将输入文件按钮的不透明度设置为 0,并将其放置在样式按钮 div 上。
关于css - 我可以在按钮内放置一个输入文件标签吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17610777/