Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    May 2004
    Location
    Laredo, Texas
    Posts
    26
    Member #
    5997
    Hi,

    I am using this right now.

    a:link {color: white;text-decoration: none }
    a:active { color: white;text-decoration: none }
    a:visited { color: white; text-decoration: none }
    a:hover { color: white;text-decoration: underline}


    But I have a page where I want to use another color scheme for other links on the same page.

    How do I do it?

    Roel

  2.  

  3. #2
    Senior Member glyakk's Avatar
    Join Date
    Nov 2003
    Location
    USA
    Posts
    1,263
    Member #
    3828
    Liked
    6 times
    You want to dig into the subject of css selectors.. What you are doing is naming ALL <a> tags to have these styles applied to them.. However you can use things like id's and classes to group elements together.. then you would call the group, and then the members of that group.. for example..

    If you had a class a div that surrounded your links.. you could call it specifically from your css..
    HTML Code:
    <html>
    <head><title>css example</title>
    <style type="text/css" media="screen">
    <!--
    .menu a:link {color: white;text-decoration: none; }
    .menu a:visited {color: white;text-decoration: none; }
    .menu a:hover {color: white;text-decoration: none; }
    .menu a:active {color: white;text-decoration: none; }
    -->
    </style>
    </head>
    
    <body>
    <div class="menu">
    <a href="link1.html">link1</a>
    <a href="link2.html">link2</a>
    <a href="link3.html">link3</a>
    <a href="link4.html">link4</a>
    </div>
    </body>
    </html>
    You will see how I ".menu" first in my css, that is because there is a div around my links that make up my menu with a class of "menu". The "." is to specify that I am calling a class. If I were using an id(<div id="menu">) then I would use "#menu" in my css instead. There are different times when you should use one or the other(for instance an ID should only be called once in a document, where as a class can be called multiple times). But for the most part they act the same.

    This is not limited to divs. You could give any element a class or id and It would behave the same way..


  4. #3
    Junior Member
    Join Date
    May 2004
    Location
    Laredo, Texas
    Posts
    26
    Member #
    5997
    got it... thanks


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 11:12 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com