When dealing with HTML markup like:
<h4><a href="...">Some heading</a></h4>
which correctly nests h4
and a
elements, you can alter the styling to remove link formatting with the following CSS snippet. This will maintain the appearance of the heading text as if the a
tag did not exist:
h4 a {
color: black;
text-decoration: none;
}
If h4
elements are styled in a color other than black, you can adjust the CSS rule to include the h4 a
selector. For example, if it is h4 { color: orange }
, update it to h4, h4 a { color: orange }
. While you could also opt to let the link inherit its parent's color with h4 a { color: inherit }
, this may not be universally supported by all web browsers.
To further customize the link behavior and prevent it from displaying the default hand cursor on mouseover, you can include the following CSS rule:
h4 a {
cursor: text;
}