SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Guru coiL's Avatar
    Join Date
    Sep 2001
    Location
    QLD, Australia
    Posts
    666
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    css and link classes

    hi
    I need some help with css I'm only a beginner and can't figure out how you do links in classes.

    I know that links are usually.
    A:link {text-decoration: blah; color: #blah;}
    A:visited {text-decoration: blah; color: #blah;}
    etc..

    but how do I make a class with them?

    div.otherlinks {A:link {text-decoration: blah; color: #blah;},A:visited {text-decoration: blah; color: #blah;}}


    hehe I know its not right cos it doesn't work, I've tried a few things but can't figure it out. Some help please.
    coiL
    "cradled in the learning curve"

  2. #2
    SitePoint Wizard Ian Glass's Avatar
    Join Date
    Oct 2001
    Location
    Beyond yonder
    Posts
    2,384
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, there are basically two ways to do that: classify the links themselves (i.e. <a class="className" href="...">):
    Code:
    .className:link { /* Style Info */ }
    .className:visited { /* Style Info */ }
    .className:hover { /* Style Info */ }
    .className:active { /* Style Info */ }
    Or with inheritance (i.e. <div class="parentName"><a href="...">):
    Code:
    .parentName a:link { /* Style Info */ }
    .parentName a:visited { /* Style Info */ }
    .parentName a:hover { /* Style Info */ }
    .parentName a:active { /* Style Info */ }
    ~~Hope This Helps

  3. #3
    SitePoint Guru coiL's Avatar
    Join Date
    Sep 2001
    Location
    QLD, Australia
    Posts
    666
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ahhh I see
    thanks for that
    coiL
    "cradled in the learning curve"


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •