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 10-01-2012, 02:17 AM   PM User | #1
john6
New Coder

 
Join Date: Sep 2012
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
john6 is an unknown quantity at this point
Question Remove underline from link - But still make cursor show hand?

Hi, does anyone know how to make links without underline, but still have the cursor/mouse know its a link and show a hand-cursor?

Thanks!
john6 is offline   Reply With Quote
Old 10-01-2012, 04:41 AM   PM User | #2
stevenmw
Regular Coder

 
stevenmw's Avatar
 
Join Date: Jun 2007
Location: OK
Posts: 446
Thanks: 26
Thanked 30 Times in 30 Posts
stevenmw is an unknown quantity at this point
Code:
text-decoration: none;
stevenmw is offline   Reply With Quote
Old 10-01-2012, 07:45 AM   PM User | #3
oliviacis
Banned

 
Join Date: Sep 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
oliviacis is an unknown quantity at this point
You got to use the style attribute as style="text-decoration:none" in the link tag as shown below:

<a href="http://www.codingforums.com" style="text-decoration:none">The Coding Forums</a>

Write this code in between the <head></head> tags, and then place your links normally.

Last edited by oliviacis; 10-01-2012 at 07:47 AM..
oliviacis is offline   Reply With Quote
Old 10-01-2012, 08:09 AM   PM User | #4
stevenmw
Regular Coder

 
stevenmw's Avatar
 
Join Date: Jun 2007
Location: OK
Posts: 446
Thanks: 26
Thanked 30 Times in 30 Posts
stevenmw is an unknown quantity at this point
oliviacis, Please make sure to wrap your code.

John, it doesn't have too be that complicated.

Use a separate stylesheet aside from your html page and use

Code:
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}

a:active {
text-decoration: none;
}

a:hover {
text-decoration: none;
}
This will take the underline away from every single link on your page. Doing it the way oliviacsis said would only take the underline away from the individual link.

Of course you can have multiple link styles by assigning a link state to a div, and all of the links in that div will refelct that link style.

Code:
#wrap a {
text-decoration: none;
}

Last edited by stevenmw; 10-01-2012 at 08:22 AM..
stevenmw is offline   Reply With Quote
Old 10-01-2012, 08:20 AM   PM User | #5
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,615
Thanks: 5
Thanked 865 Times in 842 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
stevenmw, it goes even less complicated:
Code:
a {text-decoration: none;}
will take care of all anchor elements, no need for the pseudo classes. Those are only needed if you use a:link.
__________________
Don’t click this link!
VIPStephan is offline   Reply With Quote
Old 10-01-2012, 08:25 AM   PM User | #6
stevenmw
Regular Coder

 
stevenmw's Avatar
 
Join Date: Jun 2007
Location: OK
Posts: 446
Thanks: 26
Thanked 30 Times in 30 Posts
stevenmw is an unknown quantity at this point
Quote:
Originally Posted by VIPStephan View Post
stevenmw, it goes even less complicated:
Code:
a {text-decoration: none;}
will take care of all anchor elements, no need for the pseudo classes. Those are only needed if you use a:link.

I just wanted to be detailed in case john6 wanted to customize each pseudo class.
stevenmw is offline   Reply With Quote
Old 10-05-2012, 09:55 AM   PM User | #7
oliviacis
Banned

 
Join Date: Sep 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
oliviacis is an unknown quantity at this point
I just replied to what john6 asked. He dint mention if he wants to remove the underline of all links in the entire page. Anyways, thanks for adding more info to my reply.
oliviacis 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 05:33 AM.


Advertisement
Log in to turn off these ads.