WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to change link color in body of the text only? (6 posts)

  1. foulprank
    Member
    Posted 5 years ago #

    I'm looking for a quick way to change my link color in such a way that only links in posts and pages (but not in headings or anywhere else) are affected. What changes should I make in style.css?

    Underlined links made my blog look a bit messy, so I removed the underline attribute from all links (using a {text-decoration: none;}). This was an improvement but the contrast between link and non-like text could be better. The current link color is #642 which I find very appealing in headings but in the body of the text something like #9E6935 might be more better suited.

    My blog is here and I'm using the theme Natural Essence. Thanks for any help you can give!

  2. chaoskaizer
    Member
    Posted 5 years ago #

    I'm looking for a quick way to change my link color in such a way that only links in posts and pages (but not in headings or anywhere else) are affected. What changes should I make in style.css?

    Add inside style.css

    .entry a{color:#9E6935 !important; text-decoration: none}
    .entry a:hover{color:#963 !important;text-decoration: underline }
  3. foulprank
    Member
    Posted 5 years ago #

    Well, that was mighty fast. Thanks a bunch.

  4. kathleane
    Member
    Posted 5 years ago #

    I tried adding the text above to my style.css file and it didn't change anything. Do I need to replace any text with the code above or simply insert it into the style.css file? Maybe I placed it in the wrong area? I placed it directly under
    /* Main - Content - Post */

    Any help would be much appreciated.

  5. Mark / t31os
    Moderator
    Posted 5 years ago #

    That might be because it's a visited link try using..

    .entry a:link,
    .entry a:visited,
    .entry a:active {color:#87552F; text-decoration: none}
    .entry a:hover {color:#963;text-decoration: underline}

    Adjust as required.

  6. kathleane
    Member
    Posted 5 years ago #

    I replaced the following lines I had added under /* Main - Content - Post */ in the style.css file:

    .entry a{color:#9E6935 !important; text-decoration: none}
    .entry a:hover{color:#963 !important;text-decoration: underline }

    with the following lines:

    .entry a:link,
    .entry a:visited,
    .entry a:active {color:#87552F; text-decoration: none}
    .entry a:hover {color:#963;text-decoration: underline}

    The only adjustments I made were to change the color. The links whether visited, hovering over or not visited are still the same color as regular text. The best I can do at this point to alert a reader that this is a clickable link is to make the link text bold, but that really doesn't stand out enough (as told to me by readers who can't find a link I mention).

    Could I be placing the code in the wrong place?

Topic Closed

This topic has been closed to new replies.

About this Topic