Skip to main content
Inspiring
January 6, 2017
Answered

linking style for h4 or custom class

  • January 6, 2017
  • 1 reply
  • 276 views

I am trying to target this link so that it retains its set regular state color which is #5956a5 , but when hovering/focused - I want it to go turquoise.

a.bodyLink:hover, a.bodyLink:active, a.bodyLink:focus {

    color:  rgb(66,219,215);

    text-decoration: none;

    }

<h4><strong><a class="bodyLink" href="#" target="_blank">Text Link Here</a></strong></h4>

Not working. My guess is that I need to somehow incorporate the h4 into the CSS?

I'd also like the link to be underlined on regular state - and no decoration upon hovering. This rule wold be targeted consistently for all h4 instances that hyperlink.

Maybe the custom class name of 'bodyLink' is not needed?

Thank you.

    This topic has been closed for replies.
    Correct answer Jon Fritz

    As long as you don't have other links within <h4> tags that you want to be a different color, you could use...

    h4 a:hover, h4 a:active, h4 a:focus {

        color:  rgb(66,219,215);

        text-decoration: none;

        }

    I'd remove the <strong> all together, <h4> is already bold by default and if it's not bold enough, you should be using font-weight in the css instead.


    Also, keep in mind, "active" will only change the color while the link is being clicked, it is not a "you are here" function.

    1 reply

    Jon Fritz
    Community Expert
    Jon FritzCommunity ExpertCorrect answer
    Community Expert
    January 6, 2017

    As long as you don't have other links within <h4> tags that you want to be a different color, you could use...

    h4 a:hover, h4 a:active, h4 a:focus {

        color:  rgb(66,219,215);

        text-decoration: none;

        }

    I'd remove the <strong> all together, <h4> is already bold by default and if it's not bold enough, you should be using font-weight in the css instead.


    Also, keep in mind, "active" will only change the color while the link is being clicked, it is not a "you are here" function.