Welcome to Dream.In.Code
Become an Expert!

Join 149,534 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,512 people online right now. Registration is fast and FREE... Join Now!




Changing line color under hyperlinks

 
Reply to this topicStart new topic

Changing line color under hyperlinks

Israel
22 May, 2007 - 07:50 PM
Post #1

D.I.C Addict
Group Icon

Joined: 21 Nov, 2004
Posts: 626


Dream Kudos: 175
My Contributions
I know I can change the color of the lines that appear under hyper-links like this:
CODE

<body link="#00FFFF" vlink="#008080">


But what if I set an entire body, like above, but want one hyper-link to be a different color? How do I change that one line?
User is offlineProfile CardPM
+Quote Post

no2pencil
RE: Changing Line Color Under Hyperlinks
22 May, 2007 - 07:56 PM
Post #2

My fridge be runnin OH NOEZ!
Group Icon

Joined: 10 May, 2007
Posts: 7,124



Thanked: 76 times
Dream Kudos: 2425
Expert In: Goofing Off

My Contributions
QUOTE(Israel @ 22 May, 2007 - 08:50 PM) *

I know I can change the color of the lines that appear under hyper-links like this:
CODE

<body link="#00FFFF" vlink="#008080">


But what if I set an entire body, like above, but want one hyper-link to be a different color? How do I change that one line?

Use css at the top of the html
CODE

<head>
<style type="text/css">
<!--
A.txt:link  {color: #000000; text-decoration: none}
A.txt:visited {cursor: crosshair; color: #000000; text-decoration: none}
A.txt:hover {cursor: crosshair; color: #DCDCDC; text-decoration: none}
-->
</style>
</head>
<body>
<a href="http://website" class=txt>Text Link</a> <!-- This will accept the rule in the css stylesheet -->
<a href="http://website">Text Link</a> <!-- This will be regular -->

User is online!Profile CardPM
+Quote Post

Israel
RE: Changing Line Color Under Hyperlinks
3 Jun, 2007 - 08:28 PM
Post #3

D.I.C Addict
Group Icon

Joined: 21 Nov, 2004
Posts: 626


Dream Kudos: 175
My Contributions
When I do this the link becomes dead, it doesn't connect to the site. What did I do wrong?

CODE

<style type="text/css">
body{background-image:url("./_borders/mgt00721.jpg");}
A.txt:link  {color: #FFFFFF; text-decoration: underline}
A.txt:visited {cursor: crosshair; color: #FFFFFF; text-decoration: underline}
A.txt:hover {cursor: crosshair; color: #DCDCDC; text-decoration: underline}
</style>
</head>

<body link="#00FFFF" vlink="#008080">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
<center><p>
<img src="./_borders/logo2.jpg" alt="The Inn" width="479" height="123"></p>
<p align="center"><font face="Technical" size="4"><font color="#FFFFFF">106
South Main Somewhere, GA 30458 ~ 912-489-8628 or 800-846-9466<br>

e-mail ~ </font><a href="mailto:Someone@aol.com" class=txt><font color="#FFFFFF">
frontdesk@someplaceinn.com</font></a></font></p>

Yes, I know there are [i]a lot[i] of things wrong this code before you guys rip me a new one. I'm actually trying to fix that problem. The code was made with a page-generator.
User is offlineProfile CardPM
+Quote Post

Joshnathan
RE: Changing Line Color Under Hyperlinks
3 Jun, 2007 - 08:44 PM
Post #4

New D.I.C Head
*

Joined: 25 May, 2007
Posts: 18


My Contributions
CODE

<style type="text/css">
body{background-image:url("./_borders/mgt00721.jpg");}
A.txt:link  {color: #FFFFFF; text-decoration: underline}
A.txt:visited {cursor: crosshair; color: #FFFFFF; text-decoration: underline}
A.txt:hover {cursor: crosshair; color: #DCDCDC; text-decoration: underline}
</style>
</head>

<body link="#00FFFF" vlink="#008080">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
<center><p>
<img src="./_borders/logo2.jpg" alt="The Inn" width="479" height="123"></p>
<p align="center"><font face="Technical" size="4"><font color="#FFFFFF">106
South Main Somewhere, GA 30458 ~ 912-489-8628 or 800-846-9466<br>

e-mail ~ </font><a href="mailto:Someone@aol.com" class=txt><font color="#FFFFFF">
frontdesk@someplaceinn.com</font></a></font></p>


might want to add "" for the class -> class="txt" and lose the <font> as the link color is already specified in the css.
User is offlineProfile CardPM
+Quote Post

no2pencil
RE: Changing Line Color Under Hyperlinks
3 Jun, 2007 - 08:54 PM
Post #5

My fridge be runnin OH NOEZ!
Group Icon

Joined: 10 May, 2007
Posts: 7,124



Thanked: 76 times
Dream Kudos: 2425
Expert In: Goofing Off

My Contributions
QUOTE(Israel @ 3 Jun, 2007 - 09:28 PM) *

When I do this the link becomes dead, it doesn't connect to the site. What did I do wrong?

CODE

<style type="text/css">
body{background-image:url("./_borders/mgt00721.jpg");}
A.txt:link  {color: #FFFFFF; text-decoration: underline}
A.txt:visited {cursor: crosshair; color: #FFFFFF; text-decoration: underline}
A.txt:hover {cursor: crosshair; color: #DCDCDC; text-decoration: underline}
</style>
</head>

<body link="#00FFFF" vlink="#008080">  <----- Why are you re-initilizing the link & visited links properties?
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
<center><p>
<img src="./_borders/logo2.jpg" alt="The Inn" width="479" height="123"></p>
<p align="center"><font face="Technical" size="4"><font color="#FFFFFF">106
South Main Somewhere, GA 30458 ~ 912-489-8628 or 800-846-9466<br>

e-mail ~ </font><a href="mailto:Someone@aol.com" class=txt><font color="#FFFFFF"> <--- again, you are forcing more values directly, when the overall style is set above.
frontdesk@someplaceinn.com</font></a></font></p>

Yes, I know there are [i]a lot[i] of things wrong this code before you guys rip me a new one. I'm actually trying to fix that problem. The code was made with a page-generator.


CODE

<style type="text/css">
body{background-image:url("./_borders/mgt00721.jpg");}
A.txt:link  {color: #FFFFFF; text-decoration: underline}
A.txt:visited {cursor: crosshair; color: #FFFFFF; text-decoration: underline}
A.txt:hover {cursor: crosshair; color: #DCDCDC; text-decoration: underline}
</style>
</head>
<body>
<a class=txt href="mailto:Someone@aol.com">e-mail</a> <-- This will look how you set it above.

User is online!Profile CardPM
+Quote Post

Israel
RE: Changing Line Color Under Hyperlinks
4 Jun, 2007 - 03:57 PM
Post #6

D.I.C Addict
Group Icon

Joined: 21 Nov, 2004
Posts: 626


Dream Kudos: 175
My Contributions
Ok, I tried to move class=txt to <a class=txt href="url"> and I tried putting quotes around class="txt". The link is still dead... It looks perfect, but the link is still dead?
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 09:08PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month