Click here to Skip to main content
Click here to Skip to main content
Alternative Tip

Remove blue border when image is inside the hyperlink

, 18 Aug 2011
Rate this:
Please Sign up or sign in to vote.
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
<a href="http://www.codeproject.com"><img src="Bob.gif" alt="Codeproject" style="border-style: none;" /></a>
Method 2
<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)

About the Author

thatraja
Web Developer
India India
Programmer | Dude | ||||||
 
About him & his blog? check out here. Currently he's updating the site, he'll return soon there with more things*.
 
In Codeproject, he posted a blogpost & more than couple of Tip/Tricks, hope he'll write more soon.
 
Favorite techs are MVC, WCF, Mobile, HTML5, CSS3, jQuery, etc.,
 
His hobbies are watching movies, CP, being alone, etc., But now he's working on something*.
 
* - SCAMP???
Follow on   Twitter   Google+   LinkedIn

Comments and Discussions

 
Questionwhat about imagamaps? Pinmemberjan lucas5-Feb-14 5:54 
AnswerRe: what about imagamaps? Pinmvpthatraja5-Feb-14 15:39 
GeneralRe: what about imagamaps? Pinmemberjan lucas6-Feb-14 5:49 
GeneralMy vote of 5 PinmemberFarhan Ghumra28-Jun-12 1:35 
GeneralReason for my vote of 5 Good but it is always advisable to u... PinmvpKunal_Chowdhury5-Apr-11 18:39 
GeneralRe: Agree Kunal but it's just an alternate way, that's all. Pinmvpthatraja6-Apr-11 0:02 
GeneralRe: I think it's easier to illustrate it in a tip as an inline s... Pinmemberjlafay23-Aug-11 3:17 
GeneralReason for my vote of 5 Because it is simple and really work... Pinmemberkunal_shivalkar29-Mar-11 3:46 
GeneralReason for my vote of 2 inline styles are bad PinmemberSeishin#25-Mar-11 13:46 
GeneralRe: Well it's just an alternate way. Also it will effect for sel... Pinmvpthatraja25-Mar-11 15:44 
GeneralReason for my vote of 5 It works and thus my 5, but I'd stil... PinmvpManfred R. Bihy7-Mar-11 8:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web04 | 2.8.140721.1 | Last Updated 18 Aug 2011
Article Copyright 2011 by thatraja
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid