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?
| SitePoint Sponsor |
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?





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
In case you're using Dreamweaver: http://www.thepattysite.com/dreamweaver/linkstyles.html
Bookmarks