Need help in html code

Discussion in 'HTML & Website Design' started by samflighter, Nov 12, 2008.

  1. #1
    i am currently making a web page in it i have created the default link color as white through this code Link="#00CCFF" my page contains 40% red color and rest 60 % have white color. Links above the red section containswhite as the default link color is white. i cannot change this link color to any other as links need this color to make the webpage nice. Now the contents are in the white area. there are links between contents so the background color is white and link color is also white. Now i want any code that will over right the default link color in selected area
     
    samflighter, Nov 12, 2008 IP
  2. Doc Croc

    Doc Croc Peon

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi Samflighter,

    If I'm understanding this correctly, you want to be able to change the colour, or style, of different links on your page?

    You can do this, using the following example to help you, you put something like this in your CSS:

    
    /* These are your default link styles */
    
    a:link {color:#0cf;}
    
    a:visited {color: #0cf;}
    
    a:hover {color:#fff;}
    
    a:active {color:#006633}
    
    
    
    /* These are your custom link styles */
    
    a.samflighter:link {color:#fff;}
    
    a.samflighter:visited {color: #fff;}
    
    a.samflighter:hover {color:#f00;}
    
    a.samflighter:active {color:#00f;}
    
    Code (markup):
    and then, when you want to apply the style to a specific link, you would use the following in your HTML:

    
    
    <a class="samflighter" href="http://forums.digitalpoint.com">Link</a>
    
    
    Code (markup):
    I hope that all makes sense :)
     
    Doc Croc, Nov 12, 2008 IP