Hover colour of hyperlink in HTML

29,521

    a:hover {color: red;}
    a { color: black; text-decoration: none;}
<h4 style="text-align: left;"><a href="hyperlink" target="_blank">The making of #bobthebrewbus</a></h4>
Share:
29,521
Tim Forssman
Author by

Tim Forssman

I am a postdoctoral fellow at the University of Pretoria and I am using GIS for my archaeological research. I received my PhD from the University of Oxford and before that all my training was at the University of the Witwatersrand

Updated on July 09, 2022

Comments

  • Tim Forssman
    Tim Forssman almost 2 years

    I'd like to make it so that when the mouse hovers over my hyperlink it changes colour. As it stands it remains black and so it is hard to see that the text is a hyperlink.

    Here is the HTML code:

    &lth4 style="text-align: left;">&lta href="hyperlink" target="_blank">&ltspan style="color: #000000;">The making of #bobthebrewbus&lt/span>&lt/a>&lt/h4>
    
  • Tim Forssman
    Tim Forssman about 7 years
    I'm working on a wordpress site and flipping to text to edit so it is only in HTML. Can I change to CSS or how to I translate this into HTML and add to the code?
  • ankitjain11
    ankitjain11 about 7 years
    You need to write CSS in style tags, in the document. Pseudo classes (like :hover) never refer to an element, but to any element that satisfies the conditions of the stylesheet rule.