1 reply [Last post]
Jhorra
Offline
Enthusiast
Last seen: 13 years 51 weeks ago
Joined: 2004-06-04
Posts: 57
Points: 0

Do certain things not work in ASP pages? I am viewing the source on what it outputs, but my hover effects don't seem to be working. Here is the style code.

.nav {
    width: 74px;
    height: 42px;
    background-color: #cccccc;
    }
.nav:hover {
    background-color: #338BE6;
    opacity: .5;
    filter: alpha(opacity=50);
    -moz-opacity: .5;
    }

And here is how it shows on the page.

<a href="test.html"><div class="nav">test</div></a>

Is there something wrong with my code?

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 1 day 4 hours ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5344
Points: 2965

CSS and ASP.net?

Hi Jhorra,
Links should not contain block elements such as div.
and IE only supports hover on links.
Try it this way.<a href="test.html" class="nav">test</a>

.nav { 
    display:block;
    width: 74px; 
    height: 42px; 
    background-color: #cccccc; 
    } 
.nav:hover { 
    background-color: #338BE6; 
    opacity: .5; 
    filter: alpha(opacity=50); 
    -moz-opacity: .5; 
    } 
Hope that helps