我想在一部手机上删除图片的 href..
<header id='top_header'>
<a href='index.php'><img id='crest' src='../images/868crest.png' alt='868 RCACS Crest'></a>
<img id='title' src='../images/newtitle.png' alt='868 RCACS Title'>
</header>
我目前没有任何 javascript 或 jquery,所以如果我不能只用 html 和 css,我该怎么办
最佳答案
您可以使用带有handheld
关键字和pointer-event
属性的@media
查询
@media only screen and (max-device-width: 480px) {
a {
pointer-events: none;
}
}
Demo (调整屏幕大小并将鼠标悬停在链接上)
Demo 2 (没什么花哨的,只是换了个颜色,方便大家测试)
Demo 3 (使用手持设备
不会针对计算机)
Note: I've removed
handheld
from that demo to make it work as of now.
关于javascript - 在移动时删除 anchor ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18285965/