Results 1 to 8 of 8

Thread: Hover for a div / table

  1. #1
    Join Date
    Jun 2010
    Posts
    40
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Arrow Hover for a div / table

    Hello again, this may seem like a newbie question, but I really don't know how to do a hover effect on a div or table.

    I tryed for example a name class

    Code:
    .title{
    background: none;}
    
    .title:hover{
    background: #FFF;}
    and

    Code:
    <div class="title">Title</div>
    But the hover din't work.

    Can anybody help me ?

    Thanks.

  2. #2
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    Did it not work in IE or in any browser? The background of the page isn't white right?
    Corrections to my coding/thoughts welcome.

  3. #3
    Join Date
    Jun 2010
    Posts
    40
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default

    It does not work in firefox, I guess it doesn't work in other browsers, and if your referring about the body{ background color, yes, it's black, but does it matter?

  4. #4
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    It works for me in FF. I have it as:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    .title{
    background: none;}
    .title:hover{
    background: #00ff00;
    }
    </style>
    </head>
    <body>
    <div class="title">Title</div>
    </body>
    </html>
    There might be something else conflicting on your page. I mentioned the background of your page because as a white background you wouldn't be able to tell. Please post a link or the full code of the page for additional help.
    Corrections to my coding/thoughts welcome.

  5. The Following User Says Thank You to bluewalrus For This Useful Post:

    Wisdom (07-26-2010)

  6. #5
    Join Date
    Oct 2009
    Posts
    845
    Thanks
    14
    Thanked 189 Times in 188 Posts

    Default

    It works fine in my firefox browser. Let's see your page, it may be something else preventing it from working.

  7. #6
    Join Date
    Jun 2010
    Posts
    40
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default

    Thank you so much bluewalrus !

    There is no link, I'm sorry, this is kind of a private projet, I din't have the following:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    And the endings, could you explain to me what they are exactly, if I'm asking to much

  8. #7
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    That tells the browser what kind of page is being loaded and what kind of encoding it uses.

    For detailed explanations:

    http://en.wikipedia.org/wiki/Doctype
    http://en.wikipedia.org/wiki/UTF-8
    http://en.wikipedia.org/wiki/Charset

    Validating your pages will also help you finding these problems

    http://validator.w3.org/
    Corrections to my coding/thoughts welcome.

  9. #8
    Join Date
    Jun 2010
    Posts
    40
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default

    Thank you again for your help, and the rest as well

    Cheers

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •