Site logo

Archived topic

How can I underline and bold links within content on Hover?

11 replies · Started by Amit on September 12, 2018

Viewing posts 1–12 of 12

I want my links to stand different on hover. I need them to be underlined and bold on hover!

Hi there

which links do you want to change?
Just those in the main content area?

Try this CSS:

body:not(.blog):not(.archive) .inside-article a:hover {
    font-weight: bold;
    text-decoration: underline;
}

That works fine David!
Thanks

You're welcome

How can I increase the width of underline used in text decoration and also the color.

In your current CSS remove the text-decoration property as you can't style these. And then add this CSS:

body:not(.blog):not(.archive) .inside-article a {
    position: relative;
}

body:not(.blog):not(.archive) .inside-article a:after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    border-bottom: 3px solid transparent; /* Change weight of underline */
    pointer-events: none;
}

body:not(.blog):not(.archive) .inside-article a:hover:after {
    border-bottom-color: green; /* Change color for hover state */
}

Have you fixed this?

I'm not seeing underline on the image links.

Yes, I didn't wanted extra load of custom CSS, so adjusted things with previous code only! Thanks anyways...

Awesome :)

This archived topic is closed to new replies.