Originally posted by 95 Degrees
On some pages I have tables, some with dark backgrounds, some with light. I therefore need to have 2 link attributes on the same page. How do I do that.
For example: I have
a:link { text-decoration: none; font-family: verdana; font-size: 8pt; color: #FFFFFF }
a:visited { text-decoration: none; font-family: verdana; font-size: 8pt; color: #FFFF00 }
Links are light colored so for text in tables which have white as a background (on same page) these links do not show up as there is no contrast. How do I have 2 different link color attributes on same page? !
Thanks in advance for any help you can offer a newbie to CSS
You should start using classes then. With classes, you can make multiple link-styles for one page. This is how you use them:
Code:
a.menu {text-align: left;
font-family: verdana;
font-size: 8pt;
font-weight: bold;
color: #000099}
a.menu:active {text-align: left;
font-family: verdana;
font-size: 8pt;
font-weight: bold;
color: #000099}
a.menu:visited {text-align: left;
font-family: verdana;
font-size: 8pt;
font-weight: bold;
color: #000099}
a.menu:hover {text-align: left;
font-family: verdana;
font-size: 8pt;
font-weight: bold;
color: #000000}
a.link {text-align: left;
font-family: verdana;
font-size: 8pt;
font-weight: bold;
color: #000099}
a.link:active {text-align: left;
font-family: verdana;
font-size: 8pt;
font-weight: bold;
color: #000099}
a.link:visited {text-align: left;
font-family: verdana;
font-size: 8pt;
font-weight: bold;
color: #000099}
a.link:hover {text-align: left;
font-family: verdana;
font-size: 8pt;
font-weight: bold;
color: #000000}
In your HTML-page, you call a class by refering to it like this:
Code:
<a href="yourpage.html" class=link>Link</a>
and
<a href="otherpage.html" class=menu>Next Link</a>
I hope this helps you out a bit, if you have any problems, just ring a bell
.
Bookmarks