473,396 Members | 2,002 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Getting a horizontal list in IE7

KeredDrahcir
426 256MB
I've got a problem. I need to horizntal menu so I'm using a list to do it. Everything was working fine then I decided to have a look at it in IE8 which was still fine (almost). However when I switched on compatability mode each list item was displayed on a new line. I have found one fix for it but it insn't subitable.
There are enough of my target audience using IE7 to warrent fixing it.
Expand|Select|Wrap|Line Numbers
  1. .mainmenu{
  2.     clear: both;
  3.     height: 47px;
  4.     margin: 0;
  5.     width: 980px;
  6. }
  7. .mainmenu ul{
  8.     font-family: arial rounded MT bold, arial, verdana, georgia, tahoma,  sans-serif;
  9.     list-style: none;
  10.     margin: 0;
  11.     padding-left: 0;
  12.     text-align:left;
  13. }
  14. .mainmenu li{
  15.     display: inline-block;
  16.     margin: 5px 0 0;
  17.     padding: 0;
  18.     z-index:1000;
  19.     height: 42px;
  20. }
  21. .mainmenu li a{
  22.     display: inline-block;
  23.     font-size: 11pt;
  24.     font-weight: bold;
  25.     height: 31px;
  26.     padding: 11px 21px 0;
  27.     text-decoration: none;
  28. .mainmenu li a:hover{
  29.     text-decoration: underline;
  30. }
  31.  
The text and background colours have been removed since they won't have any effect.

Expand|Select|Wrap|Line Numbers
  1. <div class="mainmenu">
  2.   <ul>
  3.     <li><a href="link">Home</a></li>
  4.     <li>Current page</li>
  5.     <li><a href="link">Page</a></li>
  6.     <li><a href="link">Page</a></li>
  7.     <li><a href="link">Page</a></li>
  8.     <li><a href="link">Page</a></li>
  9.     <li><a href="link">Page</a></li>
  10.     <li><a href="link">Page</a></li>
  11.   </ul>
  12. </div>
The only way I could fix it was to put float: left into the .mainmenu li class but that meant the menu didn't use full use of the line which is important for the layout.
Is there a solution for this that doesn't use float left. I'm willing to use JavaScript if needed.
Aug 17 '12 #1
0 1355

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: RugbyTravis | last post by:
I want to have a list that is horizontal and each <li> has different images. I also want them to change on hover. I want the words to be below the images as well. Anyone of you styles gurus have...
12
by: Dave Brown | last post by:
Hi all, Is it possible to have 4 LI items in a <UL> with the LI width set to width:25% so that each one sizes to 25% of whatever its container width is ? It doesnt seem so, the width doesnt...
6
by: ciwstudy | last post by:
I'm having problems getting the height to compress for a horizontal list in IE (styled with CSS). It works fine in other browsers. Does anyone know a way to fix this? ...
0
by: Brian Henry | last post by:
I want to pull my contact list (personal one) from the exchange server into a local text file. I know how to write stuff into a text file, just getting it from an exchange server is my problem....
8
by: Nathan | last post by:
I am trying to prevent a horizontal list from wrapping. Each list item is floated with "float: left". Currently I use an ugly hack. I set the width of the list to a large number which is...
1
by: DarthDevilous | last post by:
I've been trying to lay out a list horizontally, like at http://www.w3schools.com/css/tryit.asp?filename=trycss_float5 , but I'm having some problems. The HTML Structure is <div id="page_footer">...
9
by: Verona Busch | last post by:
Hi everybody, I am very happy to find this group. I am searching for a solution to make a horizontal list menu with submenu on hover. I found a lot of examples for horizontal lists which open...
1
by: irq3 | last post by:
I want to make a horizontal list elements, whose widths are determined by their "width" property. "width" doesn't work on inline elements, so I can't use <spanas I normally would if the width was...
1
by: nitinpatel1117 | last post by:
i am using an unordered list to display my horizontal navigation. i am using something link <ul> <li>link 1</li> <li>link 2</li> </ul>
10
by: crippletoe | last post by:
Hi all, i am looking for a way to prevent a horizontal, inline unordered list from breaking into seperate lines once contained inside a element with specific width (shorter than the list). the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.