Tuesday, September 25, 2007

Firefox img border problem

Of course, since Firefox is probably the most compliant browser, this is more an artifact than a problem. But I'd like to help people out with this, so I'll keyword it: problem, bug, issue ...

In Firefox an image (img) with (a href) link tags around it, often shows up with a visually unwanted blue border. The fix is simple. Set " border=0 " in the img tag:

< img src="file.jpg" border=0 > 

5 Comments:

Blogger J said...

tried this and it works BUT then hte site is no longer XHTML 1.0 STRICT compliant, and mine needs to be. any other way around it? Please help!! Thanks

9:31 PM  
Blogger MoonKat said...

Greg,

Thanks for the fix. Worked like a charm. j, I put the 0 border as a style in my style sheet, targeting only specific pictures. This removes the formatting from the markup, which is what I presume you meant was non-compliant.

7:38 PM  
Blogger Wes Melton said...

This post has been removed by the author.

8:31 PM  
Blogger Wes said...

Referring to an XHTML strict solution, here is the answer - just add this in to your .css file somewhere.

img {
border: 0
}

This is both IE, FF, and Safari compliant.

8:33 PM  
Blogger Wes said...

oops, forgot the ';' - its,

img {
border: 0;
}

8:34 PM  

Post a Comment

<< Home