PDA

View Full Version : image border/link border conflict (css)



solidarity
08-10-2007, 03:15 AM
I don't want images to have any borders, but I do want links to have a bottom border. I've done this in the past and
img{border:0} has always been sufficient. I'm not sure why, but it's not working now. It seems like the link styles are taking precedence over the img style.

Other pertinent code:

a:link, a:visited {
border-bottom:1px solid #DDDDDD;
color:#646464;
text-decoration:none
}
a:hover, a:active {
border-bottom:1px solid #646464;
color:#646464;
text-decoration:none;
outline:none
}

If you want to see it for yourself: freewebs.com/chickenmcflip/colophon.htm (http://freewebs.com/chickenmcflip/colophon.htm)

Thanks in advance.

_Aerospace_Eng_
08-10-2007, 03:53 AM
You need to give a class to the links that have images in them then you can do something like this

a.classname {
border-bottom:0;
}

solidarity
08-10-2007, 03:55 AM
I was afraid I was going to have to do that. It just seems like there should be an easier solution.

Thank you, though.

_Aerospace_Eng_
08-10-2007, 03:57 AM
Not with CSS no. You could use JS but that kind of defeats the purpose of CSS. Also not everyone has JS enabled.