Thread: Css Links

    #1
  1. Getting better 1 line @ a time
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Feb 2004
    Location
    Sheffield
    Posts
    1,013
    Rep Power
    33

    Css Links


    question is about CSS and links.

    I can get underline effect, background change, etc by using .a but i need to have more than one sort of link in my page, e.g. menu links cannot have the same effect as links in the main text.

    How do i set up more than two link effects?
  2. #2
  3. Senior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    424
    Rep Power
    12
    You can do:

    a:link {} as your default link and
    a.menu:link {} for your menu.
  4. #3
  5. |<.+#f@#+.&.|
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2002
    Location
    norway
    Posts
    3,009
    Rep Power
    1224
    a better way is to use the cascading in css,
    then you don't have to assign a class attribute to every link-element

    css:
    #menu a:link {
    text-decoration:none;
    font-weight:bold;
    }

    #content a:link {
    color:#000000;
    }

    html:
    <ul id="menu>
    <li><a href="#">menu link</a></li>
    </ul>

    <div id="content">
    <p><a href="#">content link</a></p>
    </div>

    in these examples the css will affect every link within the elements of either #menu or #content giving them diffrent styles.

IMN logo majestic logo threadwatch logo seochat tools logo