[Resolved] Underline links on hover

Home Forums Support [Resolved] Underline links on hover

Home Forums Support Underline links on hover

  • This topic has 21 replies, 3 voices, and was last updated 7 years ago by Leo.
Viewing 15 posts - 1 through 15 (of 22 total)
  • Author
    Posts
  • #380670
    Gian

    Hi Tom,

    I’m trying to customize a few things (GeneratePress Premium) and I was wondering if there is an option or CSS to underline links only on hover.

    Thank you in advance!

    #380690
    Leo
    Staff
    Customer Support

    Hi there,

    Try this CSS:

    .inside-article a:hover {
        text-decoration: underline;
    }

    Adding CSS: https://docs.generatepress.com/article/adding-css/

    #380692
    Gian

    It works, thank you!

    What if I would like to underline only links inside content and exclude blog post titles (h1, h2 etc)?

    #380788
    Leo
    Staff
    Customer Support

    Hmm this instead:

    .entry-content a:hover {
        text-decoration: underline;
    }
    #380849
    Gian

    Excellent, thank you!

    There’s only one last thing, I have buttons (https://docs.generatepress.com/article/adding-buttons/) and I would like also to exclude them, what should I do in this case?

    #381028
    Leo
    Staff
    Customer Support

    Try this instead:

    .entry-content a:not(.read-more):hover {
        text-decoration: underline;
    }
    #381045
    Gian

    This code works inside articles but not on the homepage, where I replaced the “Read More” link with buttons.

    Any idea how to achieve the same also on the homepage?

    Also, is it possible to change the “Read More” link to the top of the page?

    #381071
    Leo
    Staff
    Customer Support

    Can you link me to the site?

    #381083
    Gian

    Yes, sure it’s still “under construction” but you can see the changes.

     

    #381095
    Leo
    Staff
    Customer Support

    Adjusted the code above.

    #381135
    Gian

    The code above unfortunately works for “read more” buttons in homepage, but not for other buttons placed inside articles, pages etc

    Any idea how to remove the underline on every button and keep on other links?

    #381137
    Gian

    Probably solved with the CSS

    .inside-article a:not(.button.ghost):hover {
        text-decoration: underline;
    }

    What do you think?

    Thank you

    #381138
    Gian

    No, it remove underline on normal links 🙁

    #381182
    Leo
    Staff
    Customer Support

    Hmm try:

    .entry-content a:not(.read-more):not(.button):hover {
        text-decoration: underline;
    }
    #381329
    Gian

    Perfect, thank you!

    Last question, is there a simple way to change “Read More” link to the whole blog post instead of the line where the more tag is placed?

Viewing 15 posts - 1 through 15 (of 22 total)
  • You must be logged in to reply to this topic.