If we use internal styles with
identifiers, we have to set the id for the style to take effect.
Code:
<head>
<style>
a#test1
{
color: red;
background-color: orange;
}
a#test2
{
color: green;
background-color: yellow;
}
</style>
</head>
<a href="index.html" id=test1> Index </a><br><br>
<a href="index.html" id=test2> Index </a>
<style>
a#test1
{
color: red;
background-color: orange;
}
a#test2
{
color: green;
background-color: yellow;
}
</style>
</head>
<a href="index.html" id=test1> Index </a><br><br>
<a href="index.html" id=test2> Index </a>
Now you can see how we have different
styles for the same "a" tag.
Note 1: If required you
can using <span> instead of <div> tags. div tag will start and end
on new lines. span will not exceed the tag area.