简体   繁体   English

如何关闭iPhone / iPod / iPad(CSS)上的链接效果?

[英]How to turn off link effect on iPhone/iPod/iPad (CSS)?

Information: I suppose you've seen this dark box appear around a link when you click it on an iPad/iPod/iPhone. 信息:我猜你在iPad / iPod / iPhone上点击链接后会看到这个暗盒出现。 If not, click a link, and you'll see it appear and disappear when the new page has loaded. 如果没有,请单击一个链接,当新页面加载时,您将看到它显示并消失。

I have a webapp that is going to be used on all platforms. 我有一个将在所有平台上使用的webapp。 I use p-tags as links because I don't want a lot of the a-tag default functionality and appearance, and the links are executed via JavaScript. 我使用p-tags作为链接,因为我不想要很多a-tag默认功能和外观,并且链接是通过JavaScript执行的。

The problem is that even though I use p-tags, the iPad displays this annoying dark box around the link when you click on it. 问题是,即使我使用p-tag,当你点击它时,iPad会在链接周围显示这个令人讨厌的黑盒子。 The dark box is useful to tell the user that they actually managed to click the link while the next page loads, but this webapp loads stuff from localStorage, so there is no need to have this box that clutters the GUI... 黑暗框有助于告诉用户他们实际设法在下一页加载时点击链接,但是这个webapp从localStorage加载了东西,因此没有必要让这个框弄乱GUI ...

How can this box be removed? 如何删除此框?

Your reason to use paragraph (p-tags) for links is completely a mystery to me. 您使用段落(p-tags)进行链接的原因对我来说完全是一个谜。 You can control styling via CSS, no matter what tag it is. 您可以通过CSS控制样式,无论它是什么标记。 P-tags are for paragraphs, A-tags are for links. P标签用于段落,A标签用于链接。 That's the most basic thing in HTML semantics I can think of. 这是我能想到的HTML语义中最基本的东西。

The box you are refering to is "-webkit-tap-highlight-color" See http://css-infos.net/property/-webkit-tap-highlight-color 您要引用的框是“-webkit-tap-highlight-color”请参阅http://css-infos.net/property/-webkit-tap-highlight-color

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM