CSS Babble

I’m am still very much a novice when it comes to Cascading Style Sheets (CSS), but I am slowly learning through trial and error

You may have noticed that my links have changed style (the fading effect was annoying me), which I did via a CSS, but I am now trying to work out how to have some links with the dashed underline, and some without. (cause it looks really bad in some places as the moment).

So I did this in my css:

————————

a.dash:link {
text-decoration: none;
border-bottom: 1px dashed #00FF00;
color: #00FF00;
}
a.dash:visited {
text-decoration: none;
border-bottom: 1px dashed #FFFF00;
color: #FFFF00;
}
a.dash:hover {
text-decoration: none;
border-bottom: 1px dashed #FFFFFF;
color: #FFFFFF;
}
a.dash:active {background-color: #c1ff05;color: #000000}

a.nodash:link {text-decoration: none; color: #00FF00;}
a.nodash:visited {text-decoration: none; color: #FFFF00}
a.nodash:hover {text-decoration: none; color: #FFFFFF;}

a:link {
text-decoration: none;
border-bottom: 1px dashed #00FF00;
color: #00FF00;
}
a:visited {
text-decoration: none;
border-bottom: 1px dashed #FFFF00;
color: #FFFF00;
}
a:hover {
text-decoration: none;
border-bottom: 1px dashed #FFFFFF;
color: #FFFFFF;
}
a:active {background-color: #c1ff05;color: #000000}

——————–

So, I thought that I could then go through and define some links with the class of “nodash”, and some with “dash” and then others that were left would go to the default (dashed). But no, it doesn’t seem to work properly.
As you can see on the left, the images in my sidebar all have the dashed link underline, even though I have specified for them to be class=”nodash”. Is this because my default (a:link) has the dashes so it overrides the class?

I am probably doing something really stupid here. Can any lovely reader help me out?

About Mick

I've been around a while. I like to wrap myself around the warm security of the interwebs which have consumed me since 1993. I whinge, I rant, I crap on. Enjoy. View all posts by Mick

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: