1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to change link color in Style.Css?

Discussion in 'BlackHat Lounge' started by ibmethatswhoib, Jul 19, 2011.

  1. ibmethatswhoib

    ibmethatswhoib Jr. VIP Jr. VIP Premium Member

    Joined:
    Feb 17, 2011
    Messages:
    1,560
    Likes Received:
    1,156
    Occupation:
    Staying Informed
    Location:
    Bay Area, Ca
    Home Page:
    Hey quick question it's pretty basic but I can't find it. I searched g00gle but not the greatest help on there. I want to change my inbound/outbound links to blue like this color #0066DB. I tried changing where it says none below and tried some other things. Does this look like the right code to change and where do I put the color code?

    /* Hyperlinks */
    a { text-decoration: none; }
    a:hover { text-decoration: underline; }

    h1 a:link, h1 a:visited, h2 a:link, h2 a:visited, h3 a:link, h3 a:visited,
    h4 a:link, h4 a:visited, h5 a:link, h5 a:visited, h6 a:link, h6 a:visited { text-decoration: none; }
    h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover { text-decoration: underline; }
     
  2. SahL

    SahL Elite Member

    Joined:
    Jan 8, 2011
    Messages:
    1,594
    Likes Received:
    1,296
    Occupation:
    ★SEO expert and ★Sexpert
    Location:
    Bombay
    Home Page:
    If you wanna change visited link to another color, remove entity from that code and write seperatly as


    EXAMPLE for H1
    :

    h1 a:visited
    {
    color: #0066DB;
    }

    HTH

    It can be done seperately like this

    OR

    can be done together like this.

    h5 a:link h5 a:visited, h6 a:link, h6 a:visited { text-decoration: none; color : Color-code; }
    h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover { text-decoration: underline; }
     
    • Thanks Thanks x 1
    Last edited: Jul 19, 2011
  3. shudogg

    shudogg Regular Member

    Joined:
    Sep 23, 2008
    Messages:
    412
    Likes Received:
    153
    Occupation:
    Internet Marketing
    Location:
    Indiana
    Home Page:
    Code:
    a { color: #0066DB; text-decoration:non; }
    a:hover { color: #0066DB; text-decoration: underline; }
    a:visited { color: #0066DB; text-decoration: none; }
    
    That will set the base of all the links on the page (should include the h1, h2, ect.).Setting the link color and decoration for each h1, h2,.. isn't needed unless you want them to be different.

    If you want the link to change color AND underline when the user puts their mouse over it, change the color code for a:hover.
     
    • Thanks Thanks x 1