Reputation: 4518
Let's say I have some hyperlink but class and id of it are already used by other scripts. So how can I add some css to them ? I tried 2 things.
<div class='some_css'>
<a href='".$_SERVER['PHP_SELF']."' class='used' id='used1'>link1</a>
<a href='".$_SERVER['PHP_SELF']."' class='used' id='used2'>link2</a>
</div>
///css file
.some_css:a
{
color:#456e9c;
}
Another try
<span class='some_css'><a href='".$_SERVER['PHP_SELF']."' class='used' id='used1'>link1</a></span>
<span class='some_css'><a href='".$_SERVER['PHP_SELF']."' class='used' id='used2'>link2</a></span>
///css file
.some_css:a
{
color:#456e9c;
}
Both are wrong..... I know I do something wrong, please help
Upvotes: 0
Views: 2253
Reputation: 18737
a href='".$_SERVER['PHP_SELF']."' class='used other_class' id='used1'>link1</a>
So you can define more than one class to an element with using space as a seperator...
Upvotes: 0
Reputation: 724452
Use a space, not a colon (:
). Colons are meant for stuff like pseudo-classes/elements, and properties.
.some_css a
{
color:#456e9c;
}
Upvotes: 7