I have a right floated div that contains the background of a menu, menu items are divs also floated right. The container div hasn't the width set, this is because the menu items will vary from page to page. Problem is that IE 7 makes the container div 100% wide, while other browser adjust the width to the content (menu items) In other words, putting two floated divs one inside the other makes the outher one 100% wide Sample: gastongreco.com.ar/test.html <html> <head> <title>Floats Test</title> <style type="text/css"> .usermenu{ background: url('http://ppeppd.offter.com/images/menubg.gif') no-repeat left top; height: 27px; float:right; padding-left:8px; } .menuitem{ font-size: 9pt; float:right; padding: 0.3em 0.6em 0.3em 0.6em; } </style> </head> <body> <div class="usermenu"> <div class="menuitem"><a href="author/contact.php">Contact</a></div> <div class="menuitem"><a href="author/contact.php">Home</a></div> </div> </body> </html> HTML: Help is appreciated
The width of the container div is adjusted if everything is floated to the left instead of right.. Love IE7...
Hi, If i understood the problem correctly; Create a class like: And create a blank div after floated objects. Like: