Adding a style to an area tag, e.g. change the colour on hover

Is it possible to add a style to an area tag so that when I hover over each section, the colour changes or a border is displayed?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You can add :hover to each item in css.
simply add an extra item to it.

If I wanted to invert the color of a link when I hovered over it for instance, I can do:

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

You can do that with every property available for every item on your page.
I don't think that does work,  only for the <a> tag.

To get the desired effect you will need to put an onMouseOver and onMouseOut event on the tag and then call a js function from these events to change the properties.

<style type="text/css">
#tag {
<script type="text/javascript">
function mouseOVER() {
  document.getElementById("tag").style.color = "red";
function mouseOUT() {
  document.getElementById("tag").style.color = "blue";
<span id="tag" onMouseoVER="mouseOVER();" onMouseOut="mouseOUT();">Some text</span>

>> I don't think that does work,  only for the <a> tag.

I've done it, and according to the css specs, browsers should do that. (not only for a a-tag.)
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

It works in advanced browsers such as mozilla. However, IE does not fully support the standards. indeed, it will not apply "hover" to anyhting but links. (not even just <a>.. it has to have an href)

If you must have this effect in IE, use javascript to change styles:

   .objectNorm{background-color: red}
  . objectHover{bakcground-color: blue}
   function hover(this){
      this.className = "objectHover";
   function unhover(this){
      this.className = "objectNorm";


<div class="objectNorm" onmouseover="hover(this)" onmouseout="unhover(this)">div content</div>
LadousseAuthor Commented:
I apologise for not wording my question clearing (it's my first time using this site).
I want to change the style of an <area> tag in an image map. I have several highlighted areas on an image and at the moment you can't see the difference when you move the mouse from one zone to another. Ideally, I would like to change the border colour of each <area>.

Many thanks in advance,

this article gives a couple explanations (and code) of how to do this using multiple images. my previous solution might work as well, just change the style section to

   .objectNorm{border: none;}
   .objectHover{border: 2px solid #f00;}

and put the javascript calls on the area.
LadousseAuthor Commented:
It still doesn't work, but the real problem is that I don't think that it is even possible de change the style of an <area> tag. Even when I add the style {border: 2px solid #f00;} directly to the tag, it isn't displayed.
Thanks anyway for your help.
hmm. I am not familiar with the area tag... from the name, it sounds like a div. maybe you should try replacing the area with a div.
He's trying to show the distinct areas for a image map using colored borders. I don't think its possible.
I'm pretty sure its not possible, sorry
PAQed, with points refunded (50)

E-E Admin

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.