Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-11-2011, 05:45 AM   PM User | #1
austinohara
New to the CF scene

 
Join Date: May 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
austinohara is an unknown quantity at this point
Help with CSS Navigation

I noticed my navigation on a site I built, www.houseofhunger.com, does not work in IE and I'm unsure of why. I tried playing around with it but no luck. It works fine in Firefox though. Here is my HTML and CSS for the navigation.

HTML:

<ul id="main_nav">
<li><a href="http://houseofhunger.com/" accesskey="3" id="home" title="Home">Home</a></li>
<li><a href="http://houseofhunger.com/about" accesskey="4" id="about" title="About">About</a></li>
<li><a href="http://houseofhunger.com/menu" accesskey="5" id="menu" title="Menu">Menu</a></li>
<li><a href="http://houseofhunger.com/connect" accesskey="6" id="connect" title="Connect">Connect</a></li>
</ul>
</div>

CSS:


#main_nav { list-style: none; margin: 0; padding: 0;}
#main_nav li { float: left; position: relative; top: -75px; left: 50%;}
#main_nav li a { text-indent: -999999px; display: block; height: 50px; }


#home { background: url('images/home.png')-300px 0; width: 100px; }
#home:hover { background: url('images/home.png') 0 0 !important; }
#home.active { background: url('/images/home.png') -150px 0; }

#main_nav:hover li a#home { background-position: -150px 0; }

#about { background: url('images/about.png')-300px 0; width: 100px; }
#about:hover { background: url('images/about.png') 0 0 !important; }
#about.active { background: url('/images/about.png') -150px 0; }

#main_nav:hover li a#about { background-position: -150px 0; }

#menu { background: url('images/menu.png')-300px 0; width: 100px; }
#menu:hover { background: url('images/menu.png') 0 0 !important; }
#menu.active { background: url('images/menu.png') -150px 0; }

#main_nav:hover li a#menu { background-position: -150px 0; }


#connect { background: url('images/connect.png')-300px 0; width: 100px; }
#connect:hover { background: url('images/connect.png') 0 0 !important; }
#connect.active { background: url('images/connect.png') -150px 0; }

#main_nav:hover li a#connect { background-position: -150px 0; }
austinohara is offline   Reply With Quote
Old 05-11-2011, 06:17 AM   PM User | #2
izrafel
New Coder

 
Join Date: Feb 2011
Location: Melbourne, Australia
Posts: 17
Thanks: 2
Thanked 0 Times in 0 Posts
izrafel is an unknown quantity at this point
your default background images aren't being displayed in ie for some reason.

it looks like theres no space between the ) and the -300px

#home { background: url('images/home.png')-300px 0; width: 100px; }
should be
#home { background: url('images/home.png') -300px 0; width: 100px; }
__________________
Chromatix Web Design Melbourne and SEO Melbourne

Last edited by izrafel; 05-11-2011 at 06:21 AM..
izrafel is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:47 PM.


Advertisement
Log in to turn off these ads.