Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Remove image link border
Old 08-19-2008, 08:05 PM Remove image link border
FOOOD's Avatar
Average Talker

Posts: 25
Name: Jono
Trades: 0
I’m hoping this is a simple one

For the text links of my site they have a bottom border rather than underlined.

Code:
a:link { color: #E36E11; text-decoration: none; border-bottom: 1px dotted #E36E11; }
a:visited { color: #E36E11; text-decoration: none; border-bottom: none; } 
a:hover { color: #E36E11; text-decoration: none; border-bottom: 1px solid #E36E11; }
An image link on the site has the bottom border, so I added this code:

Code:
a img {border: none;}
But the image link still has the border. So I tried:

Code:
a:link img {border: none;}
a:visited img {border: none;}
a:hover img {border: none;}
But still no luck. Could anyone help?
FOOOD is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-19-2008, 08:34 PM Re: Remove image link border
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
try
Code:
a img {border: none !important;}
This tell the browser that this rule have priority over the other.

Otherwise, as the rules are cumulatives, you have to put the one taking your pictures border out after the declaration of the border.
Otherwise, you declare first that you want a bottom border on image links, and then that links must have a full border, thus overriding your first statement.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 08-20-2008, 06:51 AM Re: Remove image link border
FOOOD's Avatar
Average Talker

Posts: 25
Name: Jono
Trades: 0
Thanks, but that didn't work. I still get the border on image links.
FOOOD is offline
Reply With Quote
View Public Profile
 
Old 08-20-2008, 06:52 AM Re: Remove image link border
Angelosanto's Avatar
Webmaster Talker

Posts: 548
Name: Danny Angelosanto
Trades: 0
Do you have a link?
__________________
"The only reason some people get lost in thought is because it's unfamiliar territory."
_____________________________________
Angelosanto is offline
Reply With Quote
View Public Profile Visit Angelosanto's homepage!
 
Old 08-20-2008, 07:00 AM Re: Remove image link border
FOOOD's Avatar
Average Talker

Posts: 25
Name: Jono
Trades: 0
Yes, the site is http://www.casasolana.co.uk/

And the CSS file is at http://www.casasolana.co.uk/css/casa-style.css
(IE6 & below at http://www.casasolana.co.uk/css/casa-style-ie.css )
FOOOD is offline
Reply With Quote
View Public Profile
 
Old 08-20-2008, 07:14 AM Re: Remove image link border
Angelosanto's Avatar
Webmaster Talker

Posts: 548
Name: Danny Angelosanto
Trades: 0
try giving it a class, for example:

a.noborder:border:none;

<img src="images/casa_pdf_128.jpg" class="noborder" />



because currently it has an id value that means nothing
__________________
"The only reason some people get lost in thought is because it's unfamiliar territory."
_____________________________________
Angelosanto is offline
Reply With Quote
View Public Profile Visit Angelosanto's homepage!
 
Old 08-20-2008, 07:31 AM Re: Remove image link border
FOOOD's Avatar
Average Talker

Posts: 25
Name: Jono
Trades: 0
Thanks but still no luck

(That id was from before when I was trying divs & classes)
FOOOD is offline
Reply With Quote
View Public Profile
 
Old 08-20-2008, 08:00 AM Re: Remove image link border
Angelosanto's Avatar
Webmaster Talker

Posts: 548
Name: Danny Angelosanto
Trades: 0
Well in that case I'd give the OTHER links the class, that way they can't possibly be inherited by the image
__________________
"The only reason some people get lost in thought is because it's unfamiliar territory."
_____________________________________
Angelosanto is offline
Reply With Quote
View Public Profile Visit Angelosanto's homepage!
 
Old 08-20-2008, 01:01 PM Re: Remove image link border
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
Ok, the !important is an unnecessary hack. You're dealing with specificity here, so you have to address that.

First, at the top of your style sheet, add:
img {border: none;} - that will prevent the usual red box border that appears on any image within a link.

Second, to get rid of the imposed border you added, put the .noborder class on the <a> instead of the img and it will work - no borders at all.

a.noborder { border:none;}
In the html use <a class="noborder" ><img src="blah blah" />
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 08-20-2008, 01:11 PM Re: Remove image link border
FOOOD's Avatar
Average Talker

Posts: 25
Name: Jono
Trades: 0
Brilliant, that works perfectly! Thanks a lot LadynRed
FOOOD is offline
Reply With Quote
View Public Profile
 
Old 08-20-2008, 01:23 PM Re: Remove image link border
Angelosanto's Avatar
Webmaster Talker

Posts: 548
Name: Danny Angelosanto
Trades: 0
Quote:
Originally Posted by LadynRed View Post
Second, to get rid of the imposed border you added, put the .noborder class on the <a> instead of the img and it will work - no borders at all.

a.noborder { border:none;}
In the html use <a class="noborder" ><img src="blah blah" />
Thats what I was trying to get across lol - thanks for articulating what I couldn't Diane
__________________
"The only reason some people get lost in thought is because it's unfamiliar territory."
_____________________________________
Angelosanto is offline
Reply With Quote
View Public Profile Visit Angelosanto's homepage!
 
Old 08-20-2008, 01:24 PM Re: Remove image link border
FOOOD's Avatar
Average Talker

Posts: 25
Name: Jono
Trades: 0
Thanks for your help Angelosanto
FOOOD is offline
Reply With Quote
View Public Profile
 
Old 08-20-2008, 01:33 PM Re: Remove image link border
Average Talker

Posts: 20
Location: USA
Trades: 0
You could have also just done

Code:
img {
border: 0px solid #000000;
}
or

Code:
img a:link, img a:active, img a:hover, img a:visited {
border: 0px solid #000000;
}
__________________
Find Me (
Please login or register to view this content. Registration is FREE
)

Last edited by oliviakitty; 08-20-2008 at 01:36 PM..
oliviakitty is offline
Reply With Quote
View Public Profile Visit oliviakitty's homepage!
 
Old 08-20-2008, 02:20 PM Re: Remove image link border
johniman7's Avatar
President, JLI Media

Posts: 965
Name: John Irving
Trades: 0
Lol, olivia I was just about to recommend the same thing. I always just use 0px solid whatever color instead of the word none.
__________________
Cheers, John Irving: My Blog
JLI Media:
Please login or register to view this content. Registration is FREE
| Website Development (Link Coming Soon!)
johniman7 is offline
Reply With Quote
View Public Profile Visit johniman7's homepage!
 
Old 08-20-2008, 02:30 PM Re: Remove image link border
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
Adding invisible borders where none are needed is just extraneous code, and once you address the specificity issue, completely unnecessary.

Quote:
I always just use 0px solid whatever color instead of the word none.
Why define it that way at all when border: none; or border: 0; is all that's needed ??
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 08-20-2008, 11:01 PM Re: Remove image link border
Average Talker

Posts: 20
Location: USA
Trades: 0
Quote:
Originally Posted by LadynRed View Post
Adding invisible borders where none are needed is just extraneous code, and once you address the specificity issue, completely unnecessary.

Why define it that way at all when border: none; or border: 0; is all that's needed ??
Because, then you don't have to add to all your images/links:
class="noborder"


But, to simplify my solution further
(per your suggestion)

Code:
img {
border: 0px;
}
__________________
Find Me (
Please login or register to view this content. Registration is FREE
)

Last edited by oliviakitty; 08-20-2008 at 11:05 PM..
oliviakitty is offline
Reply With Quote
View Public Profile Visit oliviakitty's homepage!
 
Old 08-21-2008, 01:03 PM Re: Remove image link border
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
It is important to grasp the CASCADE and specificity so that such extraneous code, and adding classes to every img tag is unnecessary.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Remove image link border
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.49447 seconds with 12 queries