SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: CSS Class's...

  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2001
    Location
    Dallas, TX
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CSS Class's...

    Is it possible to have subclasses in a css? Like if i wanted a link to be class="menu", could i have the .menu include a:link, a:hover and a:active? If so how? I don't know much about css?

  2. #2
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yup...and it's not a "subclass", it's called a pseudo class:

    a:link { font-family: verdana; color: #FFFFFF; font-size: 9pt; }
    a:hover { font-family: verdana; color: #66FF00; font-size: 9pt; }
    a:visited { font-family: verdana; color: #666666; font-size: 9pt; }
    a:visited:hover { font-family: verdana; color: #66FF00; font-size: 9pt; }

    a.footer:link { font-family: verdana; color: #FFFFFF; font-size: 9pt; }
    a.footer:hover { font-family: verdana; color: #66FF00; font-size: 9pt; }
    a.footer:visited { font-family: verdana; color: #cccccc; font-size: 9pt; }
    a.footer:visited:hover { font-family: verdana; color: #66FF00; font-size: 9pt; }

    The default page style is on top. If you use a generic HREF tag then it will assume those styles. TO use the bottom set of styles, you simply call it like so:

    <a href="somelink.html" class="footer">footer links</a>
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  3. #3
    Next stop: PHP! Marina's Avatar
    Join Date
    Apr 2001
    Location
    Sweden
    Posts
    692
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


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
  •