Trouble encountered with IE7 menu displaying tables

After successfully creating a menu style that works well in IE8, FF3.6, and GC7, the challenge arose when my boss requested it to function smoothly on IE7 as well. Despite putting in considerable effort to adapt it for IE7, I couldn't achieve the same appearance.

menu.css

a{outline:none;}

.menu {
margin:0;
display:table;
padding:0;
white-space:nowrap;
width:958px;
text-align:center;
font-size:12px;
font-weight:bold;
font-family: Arial, Helvetica, sans-serif;
height: 30px;
background: transparent url("../images/menubg.jpg") repeat-x top left;
border-bottom:4px solid #92C4E9;
border-right:2px solid #005D91;
border-left:2px solid #005D91;
}
.menu ul {
list-style:none;
margin:0;
padding:0;
display:table-row;
white-space:nowrap;
}
.menu ul li{
display:table-cell;
border-right:1px solid #005D91;
border-left:1px solid #005D91;
}
.menu ul a{
display:block;
padding:12px 5px 0 5px;
text-decoration:none;
height:26px;
margin: 0 3px 0 3px;    
color:#ffffff;  
}
.menu ul a:hover{
margin: 0 3px 0 3px;    
background:transparent url("../images/menubgover.jpg") repeat-x top left;

}
.menu li ul
{   
margin:0px;
padding:0px;
display:none;
position:absolute;
background-color:#15375f;
filter: alpha(opacity=85); 
-moz-opacity:0.85; 
-khtml-opacity: 0.85;
opacity: 0.85;

}
.menu li:hover ul
{
margin:0px;
padding: 15px 15px 0px 20px;
text-align:left;
line-height:0px;
display:block;
color:#fff;
}
.menu li li
{
list-style:none;
display:list-item;
border-right:0px;
border-left:0px;
padding:0px;
}
.menu li li a
{color:#92C4E9; text-decoration:none; padding:0; margin:0px; font-weight:normal;
}
.menu li li a:hover
{color:#92C4E9; text-decoration:underline; background:none; padding:0; margin:0px; font-weight:normal;}

.present{margin: 0 3px 0 3px;background:transparent url("../images/menubgover.jpg") repeat-x top left;}

Answer №1

If you're dealing with IE7, keep in mind that it doesn't have support for display:table. Therefore, you'll need to find an alternative approach to reconstruct the menu.

Answer №2

It is unfortunate that IE's lack of support for display: table and similar features has led to the proliferation of CSS layout hacks. The hindrance of one company on web development progress is quite disheartening.

Alternatively, a solution could be to utilize display: table for compliant browsers and implement a clearfix hack specifically for IE. While using clearfix for all browsers is an option, using display: table provides faster rendering capabilities.

Answer №4

For optimal results, I recommend utilizing the CSS property display:inline-block

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Aligning a left-aligned span with inline input buttons while floating to the right

I am struggling with aligning buttons to the right side of a div while keeping everything displayed in line. Currently, the buttons appear below the span rather than beside it. I have attempted setting the button's display to "inline" and "inline-bloc ...

What is the best way to make a CSS element move with Javascript?

Currently working on a JavaScript game where I am in need of a CSS object to replace the original JavaScript object. Specifically, I want my "sword" CSS object to move along with my player object when it is Unsheathead. All the examples I find only show wh ...

The container that utilizes the grid layout is compact and has a near-invisible height

grid-template: display; font-style: "Josefin Sans", sans-serif; size-of-text: 10px; element-height: 0px; spacing-bottom: 0px; spacing-left: 0px; spacing-right: 0px; spacing-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-up: 0 ...

What is the best way to position a button at the bottom of an image?

I am facing an issue with the following code snippet: * { box-sizing: border-box; } .wrapper { position: relative; /* border:1px solid blue; */ width: 250px; } .text { position: absolute; border:1px solid red; bottom: 0px; ...

Issues with Bootstrap column rendering in IE11's Flex layout

I need assistance with the code below: .hero{ background:lightgrey; padding: 50px 0px; } <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E26 ...

Implementing jQuery stylesheet using a bookmarklet

Here's a question that may seem silly, but I'm looking to quickly apply CSS styles to a webpage by clicking on a bookmarklet. It will definitely save me time :) For example, this code does the trick: javascript:void( jQuery( ".fancybox-overlay- ...

Creating a sleek CSS drop-down navigation menu

I seem to be facing an issue with the side navigation drop down menu. Below are the link and CSS code: <nav id="nav"> <div class="menu-main_nav-container"><ul id="menu-main_nav" class="menu"><li id="menu-item-270" class="menu-it ...

Steps for adding a background color to a selected item in a bootstrap 4 navbar

Does anyone know how to make the background color of an active Bootstrap 4 navbar item cover the full height? I tried adding a background color, but it only applied partially. Here is the CSS code I used: .active { background:rgba(165, 168, 168, 0.32 ...

Troubleshooting: jQuery animation for background-color doesn't function in Internet Explorer

I've been working on a website and I'm trying to create a navigation bar similar to the one found at . My goal is to have the navbar transition from transparent to a colored background as the user scrolls down the page. For this project, I am ut ...

The resizing issue of Textarea during transitions

Whenever I add the transition property to a textarea, it automatically affects the resizing function of the textarea. Is it possible to disable the transition only when resizing the textarea, but not for the textarea itself? <textarea name="" id="" cla ...

The cards in the Bootstrap layout stack on top of one another when viewed on a mobile screen

I have a "flipping card" and another bootstrap 4 card positioned side by side. However, when tested on a mobile screen using Chrome's dev console, the second card overlaps the flipping card and covers it completely. To provide some context, I've ...

Alter the background-color of the parent div when an input is checked using CSS

.chk-circle { width: 8px; height: 8px; background: #afb0b5; border-radius: 100%; position: relative; float: left; margin-top: 4px; margin-right: 8px; } .chk-circle label { display: block; wi ...

After deploying DRF, the CSS in Django admin is not displaying

After developing a web application using Django Rest Framework and React, I faced an issue during deployment on IIS. While the deployment is successful, I encountered a problem with the Django Admin where the styles were not displaying properly. This led t ...

Shop of Chocolate in Magento

We are in the process of setting up a Magento chocolate store. Our main hurdle is figuring out how to integrate a feature that allows users to select different sizes of chocolate boxes (4 piece, 9 piece, etc.) and have the selected product added directly t ...

optimal scaling at the center, not the edge

In this code snippet, my goal is to create an effect where the div in the middle of the visible scroll section appears at full scale (scale(1);), while the other div elements scale down towards scale(0); as they approach the edges. I have included a debug ...

Pondering the importance of the "zoom" feature in creating responsive designs

Currently, I am working on creating a responsive design using HTML and CSS. However, I have encountered an issue that I need help with: When resizing the window, the layout adapts perfectly. Similarly, when zooming in or out without resizing the window, e ...

Linking Angular Template: Connect the height of one container to the height of another

My objective is to dynamically bind the height of an angular component to a div element. I am experimenting with using template reference to access the height. Is there a way to achieve this in a clean manner? I would like to implement it similar to the c ...

How to Take Out the Active Class from a Dropdown Menu in Angular 2

I am having trouble removing the 'active' class from a dropdown when an option is selected. I have successfully removed it on document click, but need help with removing it on selection. TS : ngAfterViewInit() { const elem = this.ele ...

Chrome compatibility problem with scroll spy feature in Bootstrap 3

Having trouble with scroll spy for boosters using the body method " data-spy="scroll". It seems to be working for some browsers like Edge and Google Chrome, but after multiple attempts, it still doesn't work for me. Even after asking friends to test i ...

What's the best way to ensure the BODY element occupies the full height of the HTML element?

Currently, I have implemented the sticky footer example code from Twitter Bootstrap. The sticky footer is functioning correctly, but my goal now is to extend the body (or a div) to occupy the remaining space by matching the height of the html element and a ...