Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / web / CSS3

Remove blue border when image is inside the hyperlink

4.68/5 (13 votes)
18 Aug 2011CPOL 34.5K  
DescriptionY...

Description


Your way is for all images. If you want to remove border for selected images, then you can set the border style to inline for the particular image.

Code

Method 1
XML
<a href="http://www.codeproject.com"><img src="Bob.gif" alt="Codeproject" style="border-style: none;" /></a>
Method 2
XML
<a href="http://www.codeproject.com"><img src="Bob.gif" alt="Codeproject" border="0" /></a>

Browser Compatibility


I have tested this script in the following Web browsers:

  • Internet Explorer
  • Mozilla Firefox
  • Google Chrome
  • Safari
  • Opera

Result


<img src="http://s.codeproject.com/App_Themes/Std/Img/logo225x90.gif" style="border-style: none;" title="Image without border">

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)