Appearance of links in body

  • Unknown's avatar

    I am trying to change the appearance of hyperlinks in body text of posts and pages. How can I apply changes only to body text and not headers?

    I’m using Academia which defaults to apply colour to links when hovered. I’d like to have active and hover links underlined only in the body.

    I tried the code below but the changes are applying to all links including headers and page/post body text.

    #wrap a {color: #0c5390; text-decoration: none;}
    #wrap a:hover {color: #f99734; text-decoration: underline;}

    The blog I need help with is: http://zerowastecanada.wordpress.com

    Apologies for the simple question but I just can’t figure it out!

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    To target just the links in main content areas in pages, try this:

    #wrap .entry-content a {
    	text-decoration: underline;
    }

    It works because it’s a more specific rule (adding the “.entry-content” part) that applies just to the main content area. A good way to browse through HTML and CSS for a site is by using your browser’s built in web inspector. Right-click on a link, for example, and select the “Inspect Element” option. A panel should pop up showing you the HTML for whatever you right-clicked and all of the CSS that applies to it.

  • Unknown's avatar

    Phew! Thank you for this!

    Thanks for the tip about the inspect element too!

  • The topic ‘Appearance of links in body’ is closed to new replies.