Web Analytics Made Easy -
StatCounter Css Links - CodingForum

Announcement

Collapse
No announcement yet.

Css Links

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    hi jakenoble,

    you can use classes, like this:
    Code:
    ...css...
    
    a  {
         text-decoration:underline;
         }
    
    a.red  {
         color:red;
         }
    
    a.white   {
         color:white;
         }
    
    ...HTML...
    
    <a href="#">This is a normal, underlined link.</a>
    <a class="red" href="#">This is a red link.</a>
    <a class="white" href="#">This is a white link.</a>
    -Rich
    drums | web

    Comment


    • #3
      Code:
      A:link      { ... }
      A:visited { ... }
      A:active  { ... }
      A:hover  { ... } 
      
      A.class1:link      { ... }
      A.class1:visited { ... }
      A.class1:active  { ... }
      A.class1:hover  { ... } 
      
      A.class2:link      { ... }
      A.class2:visited { ... }
      A.class2:active  { ... }
      A.class2:hover  { ... } 
      
      ...
      <a href="page.htm">link 1</a>
      <a href="page2.htm" class="class1">link 2</a>
      <a href="page3.htm" class="class2">link 3</a>
      Glenn
      vBulletin Mods That Rock!

      Comment


      • #4
        You can also do classes in divisions i.e...


        #header .black {border: 1px dashed black; color: black;}
        #sidebar .black{border: 1px solid black; color: #e0e0e0;}

        Comment


        • #5
          Cheers guys, that hits the nail right on the head.

          Jake

          Comment

          Working...
          X