-3

How do you stop a website name from being a hyperlink in 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.

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

  • Possible duplicate - http://stackoverflow.com/questions/2091168/disable-a-link-using-css – Luís P. A. May 12 '15 at 14:12
  • Can't you just not put the sitename in an anchor tag? It seems that there's some information missing in your post as to why the sitename is in an anchor tag to begin with. – Tiddo May 12 '15 at 14:15
  • Dont put the URL in an anchor tag but in a p tag? Also, if you are listing their website anyway, it is only natural to assume people will look at the site. And BTW text-decoration will not unlink a link, just get rid of the underline that is standard on links. – Callum. May 12 '15 at 14:15
  • @Callum. That's wrong. `text-decoration:none` will remove any text decorations on a link or word. You just have to target the `a` with `a:link, a:active, a:visited` and `a:hover` – knocked loose May 12 '15 at 15:52
  • @user4875251 Okay, so it mightn't JUST remove the underline but you got my point... It still won't unlink the link. Anything in an anchor tag with a URL HREF, you can't disable in CSS (not that I know of anyway). You could use Javascript to make the link return false, but I still don't understand why OP just doesn't put the text in a p tag instead ^^ – Callum. May 12 '15 at 15:56
  • Nope, there is, was a simple google search actually.. – knocked loose May 12 '15 at 15:58

1 Answers1

0

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

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

answer stolen from css-tricks.

JSFiddle

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

knocked loose
  • 3,142
  • 2
  • 25
  • 46