Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-01-2008, 08:43 PM   PM User | #1
zodehala
Regular Coder

 
Join Date: Dec 2007
Posts: 269
Thanks: 28
Thanked 0 Times in 0 Posts
zodehala can only hope to improve
remove underline from link

i have picture with link and i couldnot remove underline (or border) from it

my codes followings

Code:
<style type="text/css">
<!--
 a { text-decoration: none; }
-->
</style> 


<a href="http://www.goolge.com" title="google" target="_blank"><img src="images/ico.png" /></a>
zodehala is offline   Reply With Quote
Old 11-01-2008, 08:46 PM   PM User | #2
brazenskies
Regular Coder

 
Join Date: May 2008
Location: Oxford, UK
Posts: 422
Thanks: 14
Thanked 27 Times in 27 Posts
brazenskies is on a distinguished road
if you want to remove the b order from all linked images then add this to your styles...


Code:
img {border:0px;}
If you only want it from away from that image then use...

Code:
<img style="border:0px" src="images/ico.png" />
brazenskies is offline   Reply With Quote
Old 11-01-2008, 10:34 PM   PM User | #3
oesxyl
Master Coder


 
Join Date: Dec 2007
Posts: 6,682
Thanks: 436
Thanked 890 Times in 879 Posts
oesxyl is a jewel in the roughoesxyl is a jewel in the roughoesxyl is a jewel in the rough
Quote:
Originally Posted by brazenskies View Post
if you want to remove the b order from all linked images then add this to your styles...


Code:
img {border:0px;}
If you only want it from away from that image then use...

Code:
<img style="border:0px" src="images/ico.png" />
0 have no units,
use border: 0; or border: none;
I don't know if is about underline because op text-decoration: none, already solve this problem so I guess is about outline:

http://www.htmldog.com/reference/cssproperties/outline/

probably outline-style: none; will solve the problem.

regards
oesxyl is offline   Reply With Quote
Old 11-01-2008, 10:49 PM   PM User | #4
Bill Posters
Senior Coder

 
Join Date: Feb 2003
Posts: 1,665
Thanks: 0
Thanked 27 Times in 25 Posts
Bill Posters will become famous soon enough
Quote:
Originally Posted by oesxyl View Post
0 have no units,
brazenskies' code was perfectly adequate.

For 0 values, units are optional. You can use them if you wish. They aren't going to do any harm and won't make any functional difference.

Quote:
use border: 0; or border: none;
Heck, belt 'n' braces… border: 0 none; is perfectly valid.

Quote:
I don't know if is about underline because op text-decoration: none, already solve this problem so I guess is about outline:

http://www.htmldog.com/reference/cssproperties/outline/

probably outline-style: none; will solve the problem.
…and create another*.

Bear in mind that the outline is a property of the anchor, not the img within the anchor, so it would need to be applied to the anchor, were it wanted gone.
* Bear in mind the accessibility issus associated with removing the outline (and not replacing it with some other, effective means of denoting focus).

Fwiw, as you appear to like to drop optional bits, outline: none; should do the same job as outline-style: none;;


As you most likely know, image links adopt a blue border which text-decoration: none; will not remove. It is most likely that blue border which the OP is speaking of.

As said, brazenskies' code will do the job.
Bill Posters is offline   Reply With Quote
Users who have thanked Bill Posters for this post:
BabyJack (11-01-2008)
Old 11-01-2008, 11:02 PM   PM User | #5
oesxyl
Master Coder


 
Join Date: Dec 2007
Posts: 6,682
Thanks: 436
Thanked 890 Times in 879 Posts
oesxyl is a jewel in the roughoesxyl is a jewel in the roughoesxyl is a jewel in the rough
Quote:
Originally Posted by Bill Posters View Post
As you most likely know, image links adopt a blue border which text-decoration: none; will not remove. It is most likely that blue border which the OP is speaking of.
nobody contest brazenskies solution, read op and my post again.

regards
oesxyl is offline   Reply With Quote
Old 11-01-2008, 11:10 PM   PM User | #6
BabyJack
Regular Coder

 
BabyJack's Avatar
 
Join Date: Apr 2008
Location: Somewhere.
Posts: 602
Thanks: 43
Thanked 6 Times in 6 Posts
BabyJack is an unknown quantity at this point
Just to direct you into the right direction, and to conclude, you have an image with a purple border around it.
You need the border: none; code.
__________________
Enlightenment in Coding
Validate before Posting | Google is your friend for PC Problems | Make sure you have a doctype
BabyJack is offline   Reply With Quote
Old 11-02-2008, 09:56 AM   PM User | #7
Bill Posters
Senior Coder

 
Join Date: Feb 2003
Posts: 1,665
Thanks: 0
Thanked 27 Times in 25 Posts
Bill Posters will become famous soon enough
Quote:
Originally Posted by oesxyl View Post
nobody contest brazenskies solution, read op and my post again.
Read it perfectly well the first time, ta.

Seems clear to me that you contested it on two points, his use of units (whereby you assert that 0 has no units [as opposed to pointing out that units are optional for 0 values], suggesting you felt there was something wrong with brazenskies post) and whether that was actually the solution or not, seemingly unaware that the text-decoration property of anchors translates into the border property with anchor images.

No biggie either way. Just a pedantic observation.


Fwiw,…
Code:
a img { border: 0 none; }
…is the optimal solution, imo.

Last edited by Bill Posters; 11-02-2008 at 10:20 AM..
Bill Posters is offline   Reply With Quote
Old 11-02-2008, 12:05 PM   PM User | #8
brazenskies
Regular Coder

 
Join Date: May 2008
Location: Oxford, UK
Posts: 422
Thanks: 14
Thanked 27 Times in 27 Posts
brazenskies is on a distinguished road
wow, I think I'll just stick to the asp forum from now on!
brazenskies is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 01:57 PM.


Advertisement
Log in to turn off these ads.