我想列出一个网站但不创建链接,即在Safari中

时间:2022-11-10 22:22:17

How do you stop a website name from being a hyperlink in safari?

如何阻止网站名称成为Safari中的超链接?

I am comparing websites to each other, my client's and their competitor, in a marketing email. I want to list the competitor's site "sitename.com," but I naturally don't want to link to it and drive traffic to their site.

我在营销电子邮件中将网站与我的客户及其竞争对手进行比较。我想列出竞争对手的网站“sitename.com”,但我自然不想链接到它并为他们的网站带来流量。

I tried "text-decoration: none;" in the anchor tag to no avail.

我试过“text-decoration:none;”在锚标签中无济于事。

1 个解决方案

#1


To disable a link via css, you need to target it's pointer event:

要通过css禁用链接,您需要定位它的指针事件:

/*your links class*/ > a {
       pointer-events: none;
       cursor: default;
}

answer stolen from css-tricks.

答案是从css-tricks中偷来的。

JSFiddle

You will need to restyle the a to look like normal text.

您将需要重新设置a看起来像普通文本。

#1


To disable a link via css, you need to target it's pointer event:

要通过css禁用链接,您需要定位它的指针事件:

/*your links class*/ > a {
       pointer-events: none;
       cursor: default;
}

answer stolen from css-tricks.

答案是从css-tricks中偷来的。

JSFiddle

You will need to restyle the a to look like normal text.

您将需要重新设置a看起来像普通文本。