Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created a style as following
.box
{
  height:300px;
  width:500px;
  font-size:1em;

}
.box:hover
{
  font-weight:bold;
}


I applied it to a span as follows

Hello to world 

it works fine but the hover property does not work.
Else if, I use #box instead of .box in my css style and then Apply it as below
<span id="box">Hello to world </span>

Then the hover property works fine.

I could not understand why hover property does not work with class attribute. Can some one solve it?
Posted
Comments
sriman.ch 15-Nov-11 23:18pm    
For me its working fine yar. I dont know why its not working for you. Can you please provide the part of your aspx page code?

1 solution

Hi,
this is works fine for me. i have tested it with (IE: 8.0, FF: 6.0)
HTML
Hello to world  


You may use following:
XML
<style type="text/css">
        a .box
        {
            height: 300px;
            width: 500px;
            font-size: 1em;
        }
        a .box:hover
        {
            font-weight: bold;
        }
    </style>

 <a>Hello to world </a>


Thanks,
Imdadhusen
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900