Forum Moderators: not2easy
Hierarchy’s in CSS regarding links.
I have the following near the top of the stylesheet:
a:link {
color: #339900;
text-decoration: none;
border-bottom: 1px dotted #bbb;
}
a:visited {
color: #339900;
text-decoration: none;
border-bottom: 1px dotted #06c;
}
a:hover {
color: #333333;
border-bottom: 1px solid #fff;
}
and at the bottom of the stylesheet I have the following:
a img {
border: none;
}
However images with links are still coming out with borders - this is driving me nuts! any help would go along way to preventing me from jumping out the window :-(
ZA
You could give a class to the <a> elements which have <img> descendants - AFAIK there is no selector that selects all elements of type x whose children are of type y, which - again, assuming that I've understood you correctly, would be ideal.
Ok I got it, the way I am writing it is targeting the child and I want to target the parent, so I added this class to the <a> tag around the image and it worked
a.nobdr {
border: none;
}
a:hover.nobdr {
border: none;
}
I guess there is no other way to achive this unless using attribute selectors and these are not supported in IE (yet)
ZA