Welcome!

And don't forget to edit your signature & profile.

 

Icon

Statistics

  • Total posts 23326
  • Total topics 4050
  • Total members 5576
  • Our newest member
    feha

TOP POSTERS

Horizontal list Menu "Cascading" Bug in IE 8 (Possibly more)

All problems and developments related to (X)HTML-markup and stylesheets are discussed and resolved here.
   
Hello all,

In the attached image you can see the error that I'm talking about. I can't reproduce this on my machine using IE, but it has registered on other computers running IE 8.

Any help would be greatly appreciated.

Image

Here is my code:

CSS:

Code: Select all

#topMenu { float:left; width:575px; margin-left:50px; }
.topMenu { list-style-type:none;    }

.topMenu a {  font-family:Arial, Helvetica, sans-serif; font-size:14px; color:#333; text-decoration:none; padding:44px 20px 42px 20px; float:left; max-width:100px; clear:none; }

.topMenu1 { list-style-type:none;    }

.topMenu1 a {  font-family:Arial, Helvetica, sans-serif; font-size:14px; color:#333; text-decoration:none; padding:44px 20px 42px 20px; float:left; clear:none; }

.topMenu a:hover { color:#374f9d; background-image:url(images/menuarrow.png); background-repeat:no-repeat; background-position:bottom center; }

.topMenu1 a { font-weight:bold; color:#374f9d; background-image:url(images/menuarrow.png); background-repeat:no-repeat; background-position:bottom center; }


xhtml:

Code: Select all
<ul id="topMenu">

<?php $purparrow = $post->post_title; ?>

<?php if ($purparrow == 'Services') { ?><li class="topMenu1"><?php } else { ?><li class="topMenu"><?php } ?><a href="/butsko/services">Services</a></li>
<?php if ($purparrow == 'Portfolio') { ?><li class="topMenu1"><?php } else { ?><li class="topMenu"><?php } ?><a href="/butsko/portfolio">Portfolio</a></li>
<?php if ($purparrow == 'Some news item') { ?><li class="topMenu1"><?php } else { ?><li class="topMenu"><?php } ?><a href="/butsko/2009/09/newest-post/">News</a></li>
<?php if ($purparrow == 'Industry links') { ?><li class="topMenu1"><?php } else { ?><li class="topMenu"><?php } ?><a href="/butsko/industry-links">Industry links</a></li>
<?php if ($purparrow == 'Careers') { ?><li class="topMenu1"><?php } else { ?><li class="topMenu"><?php } ?><a href="/butsko/careers">Careers</a></li>
<?php if ($purparrow == 'Contact' || $purparrow == 'Team')  { ?><li class="topMenu1"><?php } else { ?><li class="topMenu"><?php } ?><a href="/butsko/contact">Contact</a></li>

</ul><!-- End UL id="topMenu" -->
mjbaker
Smashing <table>
 
Posts: 22
Joined: Wed Aug 26, 2009 7:40 pm
   

   
Should also note that the issue existed before "max-width" was used in the CSS
mjbaker
Smashing <table>
 
Posts: 22
Joined: Wed Aug 26, 2009 7:40 pm
   

   
I'd suggest starting by removing the float on the <a>s within the menu, and floating the <li>s left instead. I believe that should fix your issue (though you may need to tweak your CSS to make it work). Alternately, you should be able to use display:inline instead.
Benjamin Falk | student : designer : developer
http://www.falkencreative.com | http://www.twitter.com/falkencreative
User avatar
falkencreative
Smashing <li>
 
Posts: 261
Joined: Sun Jan 18, 2009 7:25 pm
Location: Chico, CA
   

   
falkencreative wrote:I'd suggest starting by removing the float on the <a>s within the menu, and floating the <li>s left instead. I believe that should fix your issue. (Or you should be able to use display:inline)


I think this is how it was originally setup when the error began, but I could be wrong, I'll try it again, thanks.

Where would you place the display:inline (I'd assume on the li in an IE specific style sheet)?

Can you possibly provide any insight into why this is not happening for me in IE8, but does with another computer?

Thank you!
mjbaker
Smashing <table>
 
Posts: 22
Joined: Wed Aug 26, 2009 7:40 pm
   

   
Where would you place the display:inline (I'd assume on the li in an IE specific style sheet)?

You should be able to place it in your regular style sheet -- it'll work just fine in other browsers.

Can you possibly provide any insight into why this is not happening for me in IE8, but does with another computer?

Are you accidentally running IE7 Compatibility mode? Other than that, I really have no idea.

If you provide a link to the site, or send it to me in a private message, (that'll let me edit using Firebug), I should be able to provide you with the actual code you need.
Benjamin Falk | student : designer : developer
http://www.falkencreative.com | http://www.twitter.com/falkencreative
User avatar
falkencreative
Smashing <li>
 
Posts: 261
Joined: Sun Jan 18, 2009 7:25 pm
Location: Chico, CA
   

   
Code: Select all
#topMenu {
  list-style: none;
  margin: 0;
  overflow: hidden;
  padding: 0;
}

#topMenu li {
  float: left;
}

#topMenu a {
  color: #333;
  display: block;
  font: 0.8em Arial, Helvetica, sans-serif;
  padding: 44px 20px 42px 20px;
  text-decoration: none;
}

#topMenu a:hover {
   color:#374f9d;
   background:url(images/menuarrow.png) no-repeat bottom center;
}

.topMenu1 a { font-weight: bold }
Andy
Smashing <h5>
 
Posts: 1025
Joined: Tue Sep 30, 2008 6:42 pm
Location: Sweden
   

   
Thanks you two, moving the float to the li element made it work.
mjbaker
Smashing <table>
 
Posts: 22
Joined: Wed Aug 26, 2009 7:40 pm
   


Return to CSS and (X)HTML



Who is online

Users browsing this forum: No registered users and 1 guest