CSS img help
- Started
- Last post
- 16 Responses
- digilee
I have tried everything I can and for some reason nothing works.
normal links have a border-bottom of dotted red 1px.
this carries over to images as well, so i thought I'd just put something like:
a:link img 'openbracket'
text-decoration: none;
border-bottom: none;
'closedbracket'but it makes no difference whatsoever.
If I change it to something like - border: solid blue 3px this shows a blue border above the red solid normal link!
anyone have any idea?
- Witt0
maybe separating the img from a: ?
img {
..
..
}a: link {
..
..
}
- doesnotexist0
yeah that, Witt. or putting an inline style in each img in the html. tedious. try seperating the two.
- rafalski0
try:
img [border:0]
- digilee0
i have:
img
link
link:imgso i have separate definitions for the links and the imgs.
Looks like I'm going to have to give the imgs a class as well, which seems a bit silly as I am sure that I have managed it elsewhere.
Thanks anyway guys.
- rafalski0
how do you apply the dotted border to links? that might be the clue. if you added a bottom border to all a's, no wonder the a around an image gets it too
- digilee0
rafalski > that's what I am doing, but, I would have thought, setting the img border-bottom to none would have solved it.
- rafalski0
you're setting border of what to none? img or a?.. it's not the img, it's the a that gets the underline i guess
- figit0
Cascading... get it. How about an inline attribute on the img element itself of border="0".
-m
- Witt0
.img { etc should work.
or try
body.img {border:none}
no need for a span in each image. let css read each html tag seperately for more control over them.
a:link img {...} probably not working if you have some links without images. it's good to have an a:link statement free for plain links. if you want to add something special to a link call that statement again:
a:link { blablabla }
a:link.img { nhanhanha }
- Witt0
oops. sorry, i didn't see your other post.
- rafalski0
again, it's not the img, it is the a that gets the border
a:link img targets the image
I think the class idea isn't bad at all, either for text or image links.
a.dotted [border:1px dotted red]
or
a.imgcontainer [border:0]
- rafalski0
a.dotted [border:1px dotted red]
rafalski
(Apr 21 07, 11:09)sorry..
a.dotted [border-bottom:1px dotted red]
- digilee0
I must have tried every combination going with no luck.
The only way to lose the border bottom on images was to change the whole link statement and lose the bottom border on everything.
It works but not what I want so I'll leave it for now and come back to it another time.
Thanks loads guys.
- rafalski0
read my previous posts digiilee, it's not the image, it's the a around it that gets the border. it's easy from there..
- Witt0
i'm not sure i'm getting the whole picture but you can try an ID to separate the img from the a tag.
[open tag]a href=etc id=img
calling the css
a:link#img
?
- maximillion_0
a img openbracket
border:none;
close bracket