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 07-26-2010, 05:12 PM   PM User | #1
Rain Lover
Regular Coder

 
Join Date: Nov 2009
Posts: 138
Thanks: 9
Thanked 0 Times in 0 Posts
Rain Lover is an unknown quantity at this point
Remove Part of a Link Underline

Hi,

How can I remove the word Text underline using inline style?
<a href="http://www.example.com/">Some Text</a>


Thanks in advance!
Rain Lover
Rain Lover is offline   Reply With Quote
Old 07-26-2010, 06:11 PM   PM User | #2
nikee
Regular Coder

 
Join Date: Jan 2009
Posts: 173
Thanks: 5
Thanked 12 Times in 11 Posts
nikee is an unknown quantity at this point
Split it into two different links and style the second one, like this:
Code:
<a href="http://www.example.com/">Some </a><a style="text-decoration: none;" href="....">Text</a>
nikee is offline   Reply With Quote
Old 07-26-2010, 06:12 PM   PM User | #3
Donkey
Regular Coder

 
Donkey's Avatar
 
Join Date: Sep 2003
Location: Blackfield UK
Posts: 309
Thanks: 1
Thanked 35 Times in 35 Posts
Donkey is an unknown quantity at this point
Code:
<p><a href="http://www.example.com/">Some</a>Text</p>
That will do it but you need to style the text in the containing element (I have used <p>) the same as the link.
__________________
" 90% of everything is crud" - Theodore Sturgeon
Filthy Beast - a 60's Rock Band
Donkey is offline   Reply With Quote
Old 07-26-2010, 06:52 PM   PM User | #4
Rain Lover
Regular Coder

 
Join Date: Nov 2009
Posts: 138
Thanks: 9
Thanked 0 Times in 0 Posts
Rain Lover is an unknown quantity at this point
Quote:
Originally Posted by nikee View Post
Split it into two different links and style the second one, like this:
Code:
<a href="http://www.example.com/">Some </a><a style="text-decoration: none;" href="....">Text</a>
It has a little problem:
When you hover your mouse over the first word it changes the color (link hover style), but the second word shows no color change and vice versa.

Thanks anyway!
Rain Lover is offline   Reply With Quote
Old 07-26-2010, 06:55 PM   PM User | #5
Rain Lover
Regular Coder

 
Join Date: Nov 2009
Posts: 138
Thanks: 9
Thanked 0 Times in 0 Posts
Rain Lover is an unknown quantity at this point
Quote:
Originally Posted by Donkey View Post
Code:
<p><a href="http://www.example.com/">Some</a>Text</p>
That will do it but you need to style the text in the containing element (I have used <p>) the same as the link.
That way, the word Text won't be a link anymore.
Rain Lover is offline   Reply With Quote
Old 07-26-2010, 08:03 PM   PM User | #6
SB65
Senior Coder

 
Join Date: Feb 2009
Location: West Yorkshire
Posts: 2,812
Thanks: 9
Thanked 681 Times in 675 Posts
SB65 will become famous soon enoughSB65 will become famous soon enough
How about:

Code:
<a href="http://www.example.com/" style="text-decoration:none"><span style="text-decoration:underline">Some</span> Text</a>
With the span removing the underline rather than adding it, FF at least leves everything underlined - this way seems to work.

I'm moderately curious as to why you should need such an effect...
SB65 is offline   Reply With Quote
Old 07-27-2010, 12:23 AM   PM User | #7
MOD YOU UPP
New Coder

 
Join Date: Jun 2010
Posts: 22
Thanks: 3
Thanked 0 Times in 0 Posts
MOD YOU UPP is an unknown quantity at this point
Quote:
Originally Posted by SB65 View Post
How about:

Code:
<a href="http://www.example.com/" style="text-decoration:none"><span style="text-decoration:underline">Some</span> Text</a>
With the span removing the underline rather than adding it, FF at least leves everything underlined - this way seems to work.

I'm moderately curious as to why you should need such an effect...
That's exactly what I was going to suggest, I guess you beat me to it!
MOD YOU UPP is offline   Reply With Quote
Old 07-27-2010, 02:45 PM   PM User | #8
Major Payne
Regular Coder

 
Join Date: Aug 2005
Location: MS
Posts: 745
Thanks: 7
Thanked 65 Times in 63 Posts
Major Payne is an unknown quantity at this point
Answered HERE.
__________________
☠ ☠RON☠ ☠
Major Payne is offline   Reply With Quote
Old 07-27-2010, 03:07 PM   PM User | #9
SB65
Senior Coder

 
Join Date: Feb 2009
Location: West Yorkshire
Posts: 2,812
Thanks: 9
Thanked 681 Times in 675 Posts
SB65 will become famous soon enoughSB65 will become famous soon enough
Quote:
Originally Posted by Major Payne View Post
Answered HERE.
..but answered here first.
SB65 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 10:36 AM.


Advertisement
Log in to turn off these ads.