【发布时间】:2021-12-30 23:15:45
【问题描述】:
我这里有这段代码
.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;
}
<span class="file-wrapper">
<input type="file" name="photo" id="photo" />
<span class="button">Choose a Photo</span>
</span>
在 Safari 和 Google chrome 浏览器中,它不会将光标显示为指针,这是怎么回事?
【问题讨论】:
-
虽然拥有 JSFiddle 是一件好事,但请始终在此处包含一些相关代码,以防 JSFiddle 在某个时候停止工作。谢谢!
-
抱歉,是您没有帮助我们了解问题所在。当我们无法理解问题不是我们的错时,期待我们投票支持您的问题。
-
@Mor Sela 你想要这个输入文件的光标只需检查这个链接jsfiddle.net/mnjKX/7
标签: html css browser mouse-cursor