Jump to content

[SOLVED] hyperlink style


ilikephp

Recommended Posts

hi,

 

I have this .css style:

A:link {

COLOR: #ffffff;  TEXT-DECORATION: none

}

A:visited {

COLOR: #ffffff;  TEXT-DECORATION: none

}

A:hover {

COLOR: #ffffff;  TEXT-DECORATION: underline

}

A:active {

COLOR: #ffffff;  TEXT-DECORATION: none

}

 

how can I let the color be the same as my text, so for example:

some paragraphs are in white, and some in blue.

and I need the hyperlink to be in white or in blue as my text.

how can we do it plz?

 

Note: When I dont put a color for the css style, the default is the blue one.

Thx...

Link to comment
Share on other sites

if you want different colored links for different paragraphs, do something like the following:

 

<style type="text/css">
p.bluestuff {
color:blue;
}
p.bluestuff a {
color:blue;
}
p.whitestuff {
color:white;
}
p.whitestuff a {
color:white;
}
</style>
...
<body>
<p class="bluestuff">text and links here will be blue</p>
<p class="whitestuff">same here except they will all be white</p>

 

you'll need to add "text-decoration:none;" in the link modifier if you want the links to blend in perfectly with text.

 

I will end this by saying I highly recommend against coloring the text the same as the links. Unless you have a special reason.

Link to comment
Share on other sites

the part without the "a" colors the text(and anything else that doesnt already have a specified color. and the "a" part colors the link.

 

Think of it like a html tag. If it was a b instead of an a, then all bolds(since the tag is < b > ) would be that color.

Link to comment
Share on other sites

no, because when you don't specify a tag(i.e. not having the a, or a h1, or anything after the class/id name), the color property applies to the text color only(links are not affected). But when you have the a after the class/id name, the color property affects only all thinks within and <a> tag.

Link to comment
Share on other sites

not wrong to put what after the function? And it's not a function, it's best to not call it that. I'd call it a tag modifier, even though it modifies more than just tags(I know it has an official name, I forgot it). But anyway, what you have posted there will only change the color of the links.

 

Think of what you're saying in that style code. You're saying that everything within a p tag that has a class of redstuff(or whitestuff) that is within an a tag will have the "color" color. So it literally, and flat out wotag modifier

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.