WordPress.org

Ready to get started?Download WordPress

Forums

changing colour of only certain links (6 posts)

  1. smith0281
    Member
    Posted 5 years ago #

    Hi, wondering if anyone can help me...

    im new to wordpress and struggling with something thats probably quite simple :(

    ive inserted the code
    a:hover {
    color: #fff ;
    background-color: #000 ;
    }

    in my style sheet which has successfully changed the background colour of my links. However i only want that instance to apply to the links in my links catagory. Is there a way i can do this?

    http://www.beyourownvalentine.co.uk/blog

    thanks!

  2. t31os
    Member
    Posted 5 years ago #

    What do you mean in your links category?

    Perhaps you mean the links under LINKS on the right-hand side.

    .xoxo a, .xoxo a:link, .xoxo a:visited { color:black; }
    .xoxo a:active { color:red; }
    .xoxo a:hover { color:green; }

    or

    .blogroll a, .blogroll a:link, .blogroll a:visited { color:black; }
    .blogroll a:active { color:red; }
    .blogroll a:hover { color:green; }

    Either should work, color was purely for example...

  3. smith0281
    Member
    Posted 5 years ago #

    hi this is perfect and does isolate it so its only the links in the right hand side. Thanks so much!
    one more thing...how would i adapt it to the scheme i had which was white text with a black background on hover?

    :)

  4. t31os
    Member
    Posted 5 years ago #

    color:black

    Was only an example...

    What goes between..
    { and }

    is up to you...

    http://www.w3schools.com/css/

    .blogroll a:hover { background:#000;color:#fff }

    You could also change background of the list element on hover like so..

    EXAMPLE:
    .blogroll li:hover { background:#ccc; }
    .blogroll li:hover a { color:#fff; }

    That will change the list element background and link color on hover... try it and see...

  5. smith0281
    Member
    Posted 5 years ago #

    Just did it and it worked!!! thanks so much for your help...your a star!

    :)

  6. t31os
    Member
    Posted 5 years ago #

    You're welcome.... ;)

Topic Closed

This topic has been closed to new replies.

About this Topic