【发布时间】:2019-04-02 14:19:06
【问题描述】:
代码非常简单,请参阅下面的部分内容。 Full example here:
纯 HTML:
<div class="test1">
<div class="silver1">
<span>test1</span>
</div>
<span>box 1</span>
</div>
CSS
.test1 {
border: 1px solid red;
width: 80px;
background-color: red;
}
.silver1 {
width: 30px;
height: 30px;
position: relative;
}
.test1:hover .silver1 {
top: 30px;
left: 80px;
border: 3px dotted blue;
background-color: yellow;
}
测试:
- 在任何流行的浏览器中用鼠标悬停在 Windows 或 麦克工作正常。
- 通过点击 Android 手机上的框,它可以工作 也一样。
- 点击 Safari (iPhone/iPad) 没有任何反应。
- 按住 Safari 有时会起作用。
问题 如何为 Safari iOS 激活 :hover? 理想的纯 CSS 解决方案。
【问题讨论】:
标签: css hover mobile-safari