CSS help (background images and nav links)

  • Pixelghetto
  • Novice
  • Novice
  • User avatar
  • Joined: Jan 03, 2005
  • Posts: 34
  • Loc: Liverpool, UK
  • Status: Offline

Post November 17th, 2005, 10:25 am

Ok so I have been wrestling with this all day and can't figure out why the hover effect on the nav works fine in Firefox but as soon as I take it into IE6 it doesn't display the correct height for the hovered background image.

I realise IE sucks for webstandards, but there are usually work arounds for such things.

Any ideas, anyone, Bueller?

http://www.pixelghetto.com/area51/

I am fairly new to the whole CSS design thing, being from the old school of tables and image slicing. :(
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post November 17th, 2005, 10:25 am

  • Zwirko
  • Guru
  • Guru
  • User avatar
  • Joined: May 29, 2005
  • Posts: 1404
  • Loc: 55° N, 3° W
  • Status: Offline

Post November 17th, 2005, 11:38 am

Change the navigation section of your css to something like this:


Code: [ Download ] [ Select ]
#navigation {
    background-image: url(nav.jpg);
    height: 34px;
    padding-top: 18px;
    }

#navigation ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    }

#navigation li {
    height: 34px;
    display: inline
    }

#navigation li a{
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: small;
    font-weight: bold;
    color: #ffffff;
    text-decoration: none;
    padding: 16px; height: 34px
    }

#navigation li a:hover {
    color:#ffffff;
    background: #99cc33 url(nav-on-bg.jpg) repeat-x
    }

#navigation li a:active {
    color:#000000;
    }
  1. #navigation {
  2.     background-image: url(nav.jpg);
  3.     height: 34px;
  4.     padding-top: 18px;
  5.     }
  6. #navigation ul {
  7.     list-style-type: none;
  8.     padding: 0;
  9.     margin: 0;
  10.     }
  11. #navigation li {
  12.     height: 34px;
  13.     display: inline
  14.     }
  15. #navigation li a{
  16.     font-family: Verdana, Arial, Helvetica, sans-serif;
  17.     font-size: small;
  18.     font-weight: bold;
  19.     color: #ffffff;
  20.     text-decoration: none;
  21.     padding: 16px; height: 34px
  22.     }
  23. #navigation li a:hover {
  24.     color:#ffffff;
  25.     background: #99cc33 url(nav-on-bg.jpg) repeat-x
  26.     }
  27. #navigation li a:active {
  28.     color:#000000;
  29.     }


I made numerous changes ... too many to list in a explanation type thing.

I think that's it ... if not, don't hesitate to get back in touch.
  • Pixelghetto
  • Novice
  • Novice
  • User avatar
  • Joined: Jan 03, 2005
  • Posts: 34
  • Loc: Liverpool, UK
  • Status: Offline

Post November 17th, 2005, 12:14 pm

Thanks mate, worked a treat! Cheers kidda! :D

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 108 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2010 Unmelted, LLC. Driven by phpBB © 2010 phpBB Group.