chomedey Posted April 7, 2010 Share Posted April 7, 2010 Hi there, I've looked in the archives for something on this because I'm sure it's a common problem, but so far I've found nothing. I have a bunch of linked images on my site, and I have specified in my css that all images should have a 1 pixel grey border. img { border:1px solid grey; } a:link img {border:1px solid grey;} a:visited img {border:1px solid grey;} a:hover img {border:1px solid grey;} a:active img {border:1px solid grey;} This works fine in safari, firefox and chrome, but in IE it's putting these godawful default link color borders around them. What can I do to get rid of them? Any ideas? Cheers. Julian Quote Link to comment https://forums.phpfreaks.com/topic/197894-unwanted-borders-on-linked-images-in-ie/ Share on other sites More sharing options...
JustLikeIcarus Posted April 8, 2010 Share Posted April 8, 2010 Looks like its due to you having a border defined for the img inside of the link but nothing set for the link itself to its getting the default border. Try adding this to the css. a { border-style:none; } Quote Link to comment https://forums.phpfreaks.com/topic/197894-unwanted-borders-on-linked-images-in-ie/#findComment-1038955 Share on other sites More sharing options...
chomedey Posted April 8, 2010 Author Share Posted April 8, 2010 Thanks. I do not have a PC to test it on close at hand but will do so asap. Much appreciated. Julian Quote Link to comment https://forums.phpfreaks.com/topic/197894-unwanted-borders-on-linked-images-in-ie/#findComment-1039114 Share on other sites More sharing options...
patriklko Posted April 17, 2010 Share Posted April 17, 2010 it seems that you need a solid grey border permanently for the image which is used as a link whether the link state is active, visited, hover so try putting the border in the image itself and set the property border=0, it will solve the problem for all the browsers and u can have border also gets displayed with the image.......... Quote Link to comment https://forums.phpfreaks.com/topic/197894-unwanted-borders-on-linked-images-in-ie/#findComment-1043593 Share on other sites More sharing options...
chomedey Posted April 17, 2010 Author Share Posted April 17, 2010 Are you suggesting I do this with CSS? Or draw the border with PHP once the images are uploaded (I haven't drawn with PHP but I know it's possible)? Clarification much appreciated. Cheers. Julian Quote Link to comment https://forums.phpfreaks.com/topic/197894-unwanted-borders-on-linked-images-in-ie/#findComment-1043696 Share on other sites More sharing options...
TeddyKiller Posted April 17, 2010 Share Posted April 17, 2010 Sometimes setting the border=0 in the img tag works. Quote Link to comment https://forums.phpfreaks.com/topic/197894-unwanted-borders-on-linked-images-in-ie/#findComment-1043701 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.