views:

49

answers:

1

hi all, i am trying to make an unordered list to behave in different browsers. i have a 2 level list which i am trying to display horizontally in one line. on safari and firefox everything looks good. on IE (7) everything goes nuts for some reason, and only when i am trying to make the list go right-to-left. when i try displaying it left to right, all browsers behave.

a simple example of what i was doing is here: http://www.g6pdrecords.com/svk/test.html the CSS is found in the .

any ideas anyone? thanks

A: 

Something like this should even work in IE6.

I removed the absolute positioning from #menu since it can be done without it, but you can put it back if you really need it.

div#contain{
 margin:0 auto;
 border: 1px dashed #000000;
 width: 1000px;
 height: 600px;
}
div#menu{
 overflow:hidden;
 margin-top:50px;
 border: 1px dashed #FF00FF;
 text-align:right;
}
ul{
 list-style-type: none;
 display: inline;
 margin: 0px;
 padding: 0px;
}
ul li{
 margin: 0px;
 padding: 0px;
 float:right;
}

In fact the HTML should be changed a bit too, validator will want to see nested ul inside of li:

<ul>
 <li>item1</li>
 <li>item2</li>
 <li>
  <ul>
   <li>sub item3</li>
   <li>sub item4</li>
  </ul>
 </li>
</ul>
rebus
hi,thanks for the help. :)but! you ignore one crucial point. the list items still go from left to right!at the moment they display: item1 item2 item3 item4they should display: item4 item3 item2 item1thats what causing all the problems for me.any solution for that?thanks!
Crippletoe
You can change `display:inline` into `float:right` for `ul li`, it seems to work fine in IE7 (don't have others to test right now), i have edited the answer to reflect this.
rebus