我的CSS代码在safari和chrome等webkit浏览器上不能正常工作。
如果你想要活的例子,这里是http://jsfiddle.net/mnjKX/1/
我有这个CSS代码
.file-wrapper {
cursor: pointer;
display: inline-block;
overflow: hidden;
position: relative;
}
.file-wrapper input {
cursor: pointer;
font-size: 100px;
height: 100%;
filter: alpha(opacity=1);
-moz-opacity: 0.01;
opacity: 0.01;
position: absolute;
right: 0;
top: 0;
}
.file-wrapper .button {
background: #79130e;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
color: #fff;
cursor: pointer;
display: inline-block;
font-size: 11px;
font-weight: bold;
margin-right: 5px;
padding: 4px 18px;
text-transform: uppercase;
}
这段HTML代码如下:
<span class="file-wrapper">
<input type="file" name="photo" id="photo" />
<span class="button">Choose a Photo</span>
</span>
这段代码显示了隐藏的输入文件标签,这里的问题是cursor:指针在webkit浏览器上不起作用。
我如何解决它或绕过/超越它?
https://stackoverflow.com/questions/7554845
复制相似问题