Question:
In HTML & CSS how do I stop links from having an underline?
Stolence
2008-11-02 07:22:19 UTC
I have changed the coding for the links:

a:link {
color: #FFFFFF;
background-color: #000000;
}

a:visited {
color: #FFFFFF;
background-color: #000000;
}

a:hover {
color: #000000;
background-color: #FFFFFF;
}

But the links still have an underline... Hah, I even tried adding "text-decoration: none;" into the coding, but it didn't work... Worth a shot :P

While I'm here, does anyone know how to have TWO link styles on a website? Say, main buttons one style, and all the other links throughout the site another? I have looked at some page sources, to see how they do it, but they have attached a style.css document and I cannot see their coding.
What I DO see, however, is with these 'main buttons' they have added a tag before the , eg: whereas the rest of the site's links are simply
Any ideas??
Eight answers:
psychodad
2008-11-02 07:36:21 UTC
Just add this to the link .

style="text-decoration:none"



You have to add the word style exactly as above



And the tag to the header

Put that at the top (or just in your CSS if you know where/what that is) and all your links will have no underline and you can replace the color with whatever you want. (#000000 is black).
LemonPro
2008-11-02 07:36:00 UTC
If you use IE, by default links are underlined. you gotta change from tool>internet option and advance tab.



To make two different link styles you need to define in respective elements as for eg:





#header {

...}



#container {

.....}



# header a:link {

..........}



# container a:link {

...........}

Above elements will make different link styles on header part and container part as defined.



Hope you got me
D a n . D a . M a n
2008-11-02 07:46:05 UTC
Above beat me to it ^^

Google!



Hope this helps.

Dan


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...