【发布时间】:2015-02-25 19:55:43
【问题描述】:
当此代码在平板电脑/移动设备上运行时,用户必须点按两次才能访问链接的 URL。相反,有没有办法在不使用“@media screen and (max-width: XXXpx)”的情况下在触摸屏设备上查看时消除悬停效果? - 我真的希望悬停效果保留在桌面网站上,无论桌面浏览器调整到何种宽度。
非常感谢!
a:link,
a:visited,
a:hover,
a:active {
color: white;
text-decoration: none;
}
#container {
position: absolute;
display: table;
width: 200px;
}
#one {
position: relative;
display: table-cell;
background-color: orange;
vertical-align: middle;
text-align: center;
height: 200px;
width: 200px;
}
#one:hover {
background-color: green;
}
#one:hover > #hello {
display: none;
}
#one:hover > #world {
font-size: 1.2em;
display: block;
}
#hello {
font-size: 1.2em;
display: block;
}
#world {
display: none;
}
<div id="container">
<a id="one" href="http://www.google.com">
<p id="hello">Hello</p>
<p id="world">World</p>
</a>
</div>
【问题讨论】:
标签: html ios css mobile tablet