Okay so I'm making my website, but for example on my index.html I have a link for home.html, the word "home" is supposed to be yellow and not underline, but instead it is blue and underlined. Need help!
![]() |
Okay so I'm making my website, but for example on my index.html I have a link for home.html, the word "home" is supposed to be yellow and not underline, but instead it is blue and underlined. Need help!
I'll do this the bad way - I'm writing up a CSS guide for this site over the weekend so check back to this category later if you want some guidance on doing it the proper way.
In between the <head> tags of your HTML page put this:
That will make all links on your page yellow and not-underlined. If you want just certain links coloured yellow, place the following between your <head> tags:Code:<style>
a {
text-decoration: none;
color: yellow;
}
</style>
Then make your HTML links look like this:Code:<style>
.link {
text-decoration: none;
color: yellow;
}
</style>
Just a quick note - Removing the underline on links if often "frowned upon". It makes it quite hard to tell what is a link and what isn't.Code:<a href="home.html" class="link">a link</a>
Ummm... is it possible it's blue because it's a followed (already clicked) link?
I like your answer but no. check it out! At www.littledan1.comQuote:
Originally Posted by NeedKarma
(the page the link is directing to hasn't been built so just look at my scripting and see what the problem is
Dan, that link won't work. If the page/link isn't there we can't look at your scripting.
Secondly, my first answer will colour the links like you asked.
ACTUALLY IT DID. I wrote the style scripting you told me and it worked. Look at it.
Here is an old HTML code way to do links with forced color... use Font tags
<a href="home.html"><font color=yellow>HOME</font></a>
My bad, the link doesn't work, cause I was lazy and I lost the domain name.
Not too sure about the underlining, but as for colour I would put the following in my body tag to make links yellow:
<body alink="yellow" vlink="yellow" link="yellow">
this will cover:
A(ctive) links - as you click on them
V(isited links
and also unclicked links
hope this is some help :s
The first set of styles will change all links that do not have a class specified in the anchor tag. The second set will only be applied to those links that have the class value set to myLinkStyle. If you are going to remove the underline from a link you should make sure that it's obvious to the user that there is a link there. What we will typically do is surround the link with [ ].
Oh... and sorry for the ugly colors... I just chose stuff off the top of my head.
Your styles would contain:
And then your links in the body:Code:<style>
a:link {
color: green;
text-decoration: none;
}
a:visited {
color: yellow;
text-decoration: none;
}
a:hover {
color: green;
text-decoration: underline;
}
a:active {
color: green;
font-weight: bold;
text-decoration: none;
}
a.myLinkStyle:link {
color: cyan;
text-decoration: none;
}
a.myLinkStyle:visited {
color: orange;
text-decoration: none;
}
a.myLinkStyle:hover {
color: cyan;
text-decoration: underline;
}
a.myLinkStyle:active {
color: cyan;
font-weight: bold;
text-decoration: none;
}
</style>
Code:This is a link to [ <a href="http://www.yahoo.com">Yahoo</a> ]<br>
This is a link to [ <a href="http://www.google.com" class="myLinkStyle">Google</a> ]
All times are GMT -7. The time now is 05:29 PM. |