• I’m using this theme: https://www.wordpressthemesbox.com/2008/05/03/maroon-lily/

    The links in the posts don’t differ much from the regular text, and I’ve been trying to add an underline to them. But if I go to my stylesheet and write

    a:link{color:#520e0f; text-decoration:underline;}, a:visited{color:#520e0f; text-decoration:none;}
    a:hover{color:#000;}

    then all my links become underlined: all pages in the navbar, the blog’s name and so on. It doesn’t look very nice. How do I make sure ONLY the links in posts are underlined? Thanks..

Viewing 5 replies - 1 through 5 (of 5 total)
  • Because the theme demo only shows images and no regular text, I was unable to test this. But I tested it with the meta links and it worked.

    In your style sheet, add a new entry class, so that the entire links section looks like this

    /**************** Links *********************/
    a:link, a:visited{color: #520e0f; text-decoration:none;}
    a:hover{color:#000;}
    
    .entry a:link, a:visited{color: #520e0f; text-decoration:underline;}
    a:hover{color:#000;}

    I’m pretty sure this will work, but if .entry does not do it, try with .post

    Thread Starter amilabosnae

    (@amilabosnae)

    Thank you buddha trance, I’ve now fiddled around with it and it works with this version:

    /**************** Links *********************/
    a:link, a:visited{color:#520e0f; text-decoration:none;}
    a:hover{color:#000;}

    .post a:link{color:#520e0f; text-decoration:underline;}, a:visited{color: #520e0f; text-decoration:underline;}
    a:hover{color:#000;}

    Thread Starter amilabosnae

    (@amilabosnae)

    Very strange: The change I made doesn’t work for new posts! I just wrote a new one and the links in it are not underlined :-S What did I do wrong? Thanks..

    Don’t forget to add .post before the other modes as well:

    .post a:link{color:#520e0f; text-decoration:underline;}
    .post a:visited{color: #520e0f; text-decoration:underline;}
    .post a:hover{color:#000;}

    Thread Starter amilabosnae

    (@amilabosnae)

    It looks like it’s working, thank you!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to format links in posts ONLY’ is closed to new replies.