Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to remove blue border from image links 2

Status
Not open for further replies.

worldwise

Programmer
Jun 1, 2005
112
US
Hi,

What is the CSS code to remove the blue border from image hyperlinks?

I've tried setting text-decoration: none; and also border-width: 0px; but that doesn't seem to work so I need some help.

Thanks~
 
For images within hyperlinks not to have a blue border, use this:
Code:
<style type="text/css">
a img { border: none; }
</style>
This means, all images that are inside a tags will have no border.
 
Even if that is not a css property (and was actually scrapped in XHTML 1.0 Strict). :)
 

Vragabond is right (of course)... if you remove the whole border="0" (which you'd have to place in the HTML on all your images) you can use the CSS he posted for all images on the page - now and into the future... without any need for you to remember to add the (deprectaed) border="0" code.

Give it a try! It's certainly more "correct" to use the CSS to do this (and move towards data/presentation seperation).

Cheers,
Jeff

 
hehe,

thats true because I originally wanted to use CSS and I did use - border: none; - for the a:link tag but that didn't work.

I guess it only works on the img tag.

But i appreciate all your added comments to help keep my code "correct" !!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top