Grow your CSS skills. Land your dream job.

Pls help with my css??????

  • # June 12, 2008 at 2:38 pm

    Hi All,I’m having kind of head ache here.I’m trying to rollover the background image in my table cell,
    but it seems that when I try to hover,nothing is happening.
    So I give you now the code and hopefully you could spot where my error is:

    Below,it’s my .css(external) code:
    .mynav {
    position:absolute;
    border:1px solid blue;
    top: 0;
    }

    .da_link td {
    border:1px solid #B8860B;
    }

    .da_link td a {
    color:gray;
    text-decoration: none;
    background-image: url(../Da_web/images/home.gif);
    }

    .da_link td a:hover {
    background-image: url("../Da_web/images/home1.gif");
    }

    And here is my HTML code

    <div id="nav">
    <table cellpadding="0" cellspacing="5" class="mynav">
    <tr>
    <td><a href="milu_arts.html" title="All about Milu" class="da_link"><img src="../Da_web/images/milu_arts.gif" border="0" /></a>
    </td>
    </tr>
    </table>
    </div>

    I hope you correct me as I’m going no where .
    With a a lots of appreciation.

    # June 12, 2008 at 5:31 pm

    There are some things I’d change in your code:

    Code:

    Delete the table ;-) I can’t see any reason to use it there. Just use something like this:

    Code:

    Since you are using an image inside the link tag, I’m pretty sure you won’t see any hover action since this image is simpy lying on top of your background images. There are some really good tutorials about css sprites, especially the use in a navigation is discussed. I highly recommend reading these, for example right here in Chris’ blog. I’m pretty sure that will help a lot :)

    Hope you could use my advice!

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".