HTML Anchor, Disable Style

Viewed 60068

I have some html anchor link code, and unlike the rest of document I want it to look like it is not a link.

Is there a simple way to disable the style change caused by wrapping text in a anchor tag without having to brute force it to be the same (ie, if I change the body font style I don't have to also change some other :link stuff).

4 Answers

Here is a handy snippet if you want to copy-paste the accepted solution into React

const UnstyledLink = ({ href, children }) => (
  <a
    href={href}
    style={{
      textDecoration: "inherit",
      color: "inherit",
      cursor: "auto",
    }}
  >
    {children}
  </a>
);

Related