Click to See Complete Forum and Search --> : Links in HTML
HairyDave
Oct 3rd, 2002, 08:55 AM
Simple one - hopefully.
Anyone tell me how to create hyperlinks in HTML which do not get underlined as standard?
I want www.mywebpage.com to be without underline.
Simple ya? Hope so.
Thanks
HD
msimmons
Oct 3rd, 2002, 09:03 AM
Originally posted by HairyDave
I want www.mywebpage.com to be without underline.
with CSS:
<a href="http://www.mywebpage.com" style="text-decoration:none;">www.mywebpage.com</a>
Michael
HairyDave
Oct 3rd, 2002, 09:06 AM
Nice. Thanks for that
HD
Rick Bull
Oct 3rd, 2002, 09:18 AM
You could also create a class for that if you want to use it on multiple links:
<head>
<style type="text/css"><!--
a.noU { text-decoration: none; }
--></style>
</head>
<body>
<a href="#" class="noU">asd</a>
newDay
Oct 3rd, 2002, 04:20 PM
Originally posted by Rick Bull
You could also create a class for that if you want to use it on multiple links:
<head>
<style type="text/css"><!--
a.noU { text-decoration: none; }
--></style>
</head>
<body>
<a href="#" class="noU">asd</a>
sorry can expline this :confused: :confused:
with a real example
thinks :D
msimmons
Oct 3rd, 2002, 04:25 PM
Originally posted by newDay
sorry can expline this :confused: :confused:
with a real example
thinks :D
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<head>
<style type="text/css"><!--
a.noU { text-decoration: none; }
--></style>
</head>
<body>
<a href="#" class="noU">link1</a>
<a href="#" class="noU">link2</a>
<a href="#" >link3</a>
</body>
</HTML>
How much do you need explained? I'm going to assume you understood my post with the "inline" style. When you put the style in the head as shown you can assign it to a class and give it to multiple elements. So, if you notice in the example I have two links set to that class... they will not have the text decoration but the third link which has no class (pun not intended ;) ) will be underlined. "a.noU" is two parts the a means "apply this to all a tags (links) that are of class "noU"
hope that helps, if not just post :)
Michael
HairyDave
Oct 4th, 2002, 10:48 AM
Cheers for that - don't suppose you could tell me how to get a link to change colour when the mouse hovers above the link? I know you can declare javaScript for the onMouseOver - is this the way to do it?
If so, could you give a very simple example of it - and if not what is the way?
Thanks very much
HD
msimmons
Oct 4th, 2002, 10:50 AM
.catlink {color: #000000;}
.catlink:hover {color: #ffffff;}
:)
Michael
HairyDave
Oct 4th, 2002, 11:11 AM
Sorry to be so dense, how does this fit in with the example you gave before. I have tried this:
<head>
<style type="text/css"><!--
a.noU { text-decoration: none; }
a.catlink {color: #000000;}
a.catlink:hover {color: #ffffff;}
--></style>
</head>
Is this right? I don't seem to be able to get the link to change colour.
Any help would be gratefully received.
HD
msimmons
Oct 4th, 2002, 11:16 AM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<head>
<style type="text/css"><!--
a.noU { text-decoration: none; }
a.catlink {color: #000000;}
a.catlink:hover {color: #ffffff;}
--></style>
</head>
<body>
<a href="#" class="noU">link1</a>
<a href="#" class="noU">link2</a>
<a href="#" class="catlink">link3</a>
</body>
</HTML>
will cause link 3 to have the rollovers but I assume that you want the underline & rolover on the same link:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<head>
<style type="text/css"><!--
a.noU { text-decoration: none; color: #000000;}
a.noU:hover { text-decoration: none; color: #ffffff;}
--></style>
</head>
<body>
<a href="#" class="noU">link1</a>
<a href="#" class="noU">link2</a>
<a href="#" >link3</a>
</body>
</HTML>
no need for appoligies... only way to learn is to ask and I was quite obsure in my post :)
Michael
HairyDave
Oct 4th, 2002, 11:20 AM
:cool: :) :cool:
Cheers mate - works like a dream. Unfortunately I haven't done much of this before so I'm a bit of a beginner trying to get it done quickly - isn't it always the way - for a project.
Thanks again.
HD
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.