CSS ?
- Started
- Last post
- 7 Responses
- fullfront
so, i have a style guide linked to an html page... I was wondering if i could by pass the hover state by adding a style right on the html ...
kind of like this:
09.08.03 - Drawing 01
- fullfront0
repost
a href="090803.html" style="a:hover: #u8u8u8;" target="_self" > 09.08.03 - Drawing 01 </a
- ikbenvanrijn0
could do that.. but that would be a universal call on the link. if you a specific link class might want to use this:
.newlink a:hover {
color: #8D8D8D;
FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;
background: #8D8D8D;
text-decoration: none
}then call the class in the link in the td or a div/span tag
- fullfront0
Actually that is what I am doing, but I want to set a different background color on each link with out having to create a different class each time.
That is why I was hoping I could by pass the main style with a style on the a href
- ikbenvanrijn0
your doing the same amount of owrk either way
- fullfront0
good point !
- monNom0
you could set a global style for your links and then have different classes foreach colour
eg:
a {font-size: 12px; text-decoration: none; etc...}
.link1(color: #ff0000;}
.link2(color: #00ff00;}
.link3(color: #0000ff;}
.link4(color: #cccccc;}
.link5(color: #ffcccc;}
.link6(color: #ccffcc;}a href="#" class="link1"
a href="#" class="link2"
etc...that way should require less code and provide for easy editing across the site...
I'm pretty sure the last style declaration is the one that counts when CSS is parsed, so if you did have another link assigned, or even another styyle sheet in the head of your document, it would overwrite your linked styles (only those which have a conflict).
- fullfront0
I will try that tomorrow...
thanks !