EchoFool Posted March 2, 2010 Share Posted March 2, 2010 Hey I currently use images as a link but for some reason it puts a white border around my image which is really annoying. I don't understand why because the href class im using does not have a border in its properties.. this is what i got: a:active, a:visited, a:link { color: #FFFFFF; font-weight: bold; text-decoration: none; } a:hover { color: #5a85b9; } a.forums:active, a.forums:visited, a.forums:link { color: #5a85b9; font-weight: bold; text-decoration: none; } a.forums:hover { color: #355c8b; } a.imgurl:active, a.imgurl:visited, a.imgurl:link { font-weight: bold; } a.imgurl:hover { color: #355c8b; } Im using imgurl for my images that are urls but i included all my link classes encase you can see why its happening.. my html is this: <a class="imgurl" href="?admin"> <img src="images/admin.png"> </a> Quote Link to comment https://forums.phpfreaks.com/topic/193867-img-and-a-href-problem/ Share on other sites More sharing options...
isedeasy Posted March 2, 2010 Share Posted March 2, 2010 have you tried a.imgurl:active, a.imgurl:visited, a.imgurl:link { font-weight: bold; border:none; } or maybe a.imgurl img { border:none; } Without a link to the page in question its impossible to tell whats causing it. Do you have firebug installed? if so then you should be able to spot what's causing it. Quote Link to comment https://forums.phpfreaks.com/topic/193867-img-and-a-href-problem/#findComment-1020414 Share on other sites More sharing options...
EchoFool Posted March 2, 2010 Author Share Posted March 2, 2010 Well theres nothing else involved other than including the .css file so i can't imagine any thing affecting it. Quote Link to comment https://forums.phpfreaks.com/topic/193867-img-and-a-href-problem/#findComment-1020527 Share on other sites More sharing options...
isedeasy Posted March 2, 2010 Share Posted March 2, 2010 it could be default browser margin/padding. Install firebug and inspect the <img> tag and the <a> tag around it to see exactly what CSS attributes are being applied. Quote Link to comment https://forums.phpfreaks.com/topic/193867-img-and-a-href-problem/#findComment-1020530 Share on other sites More sharing options...
EchoFool Posted March 2, 2010 Author Share Posted March 2, 2010 Okay i found the problem but i dont know how to fix the problem here is the firebug: IT uses imgurl but also then straight after uses the normal a class which it should not - why is this ? Quote Link to comment https://forums.phpfreaks.com/topic/193867-img-and-a-href-problem/#findComment-1020543 Share on other sites More sharing options...
isedeasy Posted March 2, 2010 Share Posted March 2, 2010 Because although it has a class name its still an anchor tag have a read of this http://hungred.com/useful-information/css-priority-order-tips-tricks/ Quote Link to comment https://forums.phpfreaks.com/topic/193867-img-and-a-href-problem/#findComment-1020596 Share on other sites More sharing options...
EchoFool Posted March 2, 2010 Author Share Posted March 2, 2010 now im lost out of my mind - so will i have to change how the normal a. tag is ? Quote Link to comment https://forums.phpfreaks.com/topic/193867-img-and-a-href-problem/#findComment-1020604 Share on other sites More sharing options...
isedeasy Posted March 2, 2010 Share Posted March 2, 2010 No, any property you place in "a.imgurl" will overwrite properties in "a". The properties that have a strike-through in firebug have been overwritten somewhere else in the CSS file Quote Link to comment https://forums.phpfreaks.com/topic/193867-img-and-a-href-problem/#findComment-1020618 Share on other sites More sharing options...
EchoFool Posted March 2, 2010 Author Share Posted March 2, 2010 But if you look at post 1 on this thread - surely it should over write then ? As its after the first initial A href properties :S ? Quote Link to comment https://forums.phpfreaks.com/topic/193867-img-and-a-href-problem/#findComment-1020633 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.