I have images that I've specified a border of 1 for but as they are links I get the ugly blue border on them. I'm sure it is something simple maybe in CSS to fix this. Please help.
<img src="imf.gif" style="border-style:solid;border-color:black;border-size:3px;"> _________________________________________________________
for the best results to your questions: FAQ333-2924
Is your question a most FAQ?? Find out here FAQ333-3048
then call the class name in the tag with class="img" or some other naming
eg: save as style.css
.img {
border-style:solid;
border-color:black;
border-size:3px;
then import the file with
<link rel="stylesheet" href="style.css" type="text/css"> _________________________________________________________
for the best results to your questions: FAQ333-2924
Is your question a most FAQ?? Find out here FAQ333-3048
sorry.. I should've said without creating a class either. Thank you for the detailed info tho. I've done what I'm trying to do before but can't remember how (and can't remember the site..doh!) I'm sure there is an attribute to add to a: or something like that.
it has to be (in the html) just a standard <img src=pic.jpg border=1> tag without styles or classes. The reason being the images will be used within a CMS and the client has to be able to add further images without specifing styles etc.
The default border color is defined in the <BODY> tag for the link and vlink attributes. If you want to change the color without all that CSS, just change what it is in the BODY tag.
However, I feel that not having a border is the best solution (why that isn't the default - ask the WC3?). So I ALWAYS put the attribute border="0" in my <IMG> tags.
Hope this helps, Einstein47 ("Vision without action is a daydream - Action without vision is a nightmare. Japanese Proverb"
Changing the link and vlink attributes will change the colour of text links as well as border colours. They're also both deprecated in HTML 4.01 in favour of CSS.
I think the thinking behind the coloured border appearing by default is that there should be some visual cue that a particular image is also a link. However, I agree that in the vast majority of cases the nature of the image (e.g. button, advert) or common convention (logo in top-left) makes it obvious. And those blue borders do look horrible... -- Chris Hunt
Extra Connections Ltd
I found this forum by searching for the same answer. I think what I can do now is globally avoid the dreaded blue border, with:
a img {border:none;}
a.one:img {border-color:black;} as a class for the link when I want it to have a black border. I tried this and for some reason I am not getting my colored border with <a class="one" href etc.> I also tried it specifying a.one:img {border:1 pt black solid;} Still not working and not sure what I am doing wrong. I like learning things so any help would be appreciated. This looks like a wonderful forum.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.