Issues with menu items overlapping have been identified in IE8

Hey there! I've noticed that two of my menu items are overlapping in IE8 (please see the screenshot below - specifically the "About Us" and "Press" items, with a white background between them) on my website http://goo.gl/34oQ8. Any insights on why this might be happening?

CSS Code

#nav
{
        right:2%;
        list-style:none;
        position:fixed;
        /* float:right; */
        top:30px;
        z-index:1000;
        /* width:520px; */
}

#nav > li {
    display: inline-block;
    /* dirty hack for IE7 */
    *display: inline;
    *zoom: 1;
}

#nav a
{
        font:12px 'Open Sans', "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
        font-weight:600;
        letter-spacing:1px;
        float:left;
        top:30px;
        display:inline-block;
        font-size:11px;
        margin-left:5px;
        margin-right:5px;
        padding-left:15px;
        padding-right:15px;
        text-decoration:none;
        height:24px;
        color:#666;
        line-height:24px;
        text-align:center;
        box-shadow:1px 1px 2px rgba(0,0,0,0.2);
        /* background:rgba(255,255,255,0.9);  removed not ie8 compatible */
        text-transform:uppercase;
        background: white;
    opacity: 0.8;
    filter: Alpha(opacity='80');
}

#nav a:hover
{
        background:#dedede;
}

#nav .current a
{
        background:#666;
        color:#ededed;
}

HTML Code

    <ul id="nav">
  <li class="current"><a href="#presentation">Home</a></li>
  <li><a href="#equipe">Team</a></li>
  <li><a href="#plan-activite">About us</a></li>
  <li><a href="#medias">Press</a></li>
  <li><a href="#inline" class="modalbox">Contact</a></li>
</ul>

Answer №1

Applying a margin to <a> tags may not have the desired effect of spacing out your <li> elements. Consider adding margin-left and/or margin-right to the nav li selector instead.

Additionally, HTML5 introduces the <nav> tag which can be used to replace the id="nav" in a more elegant way.

Answer №2

To ensure cleaner code, it is recommended to relocate all spacing and padding elements to the #nav > li.

The #nav a code should strictly focus on styling the link item, while the LI can be utilized for styling the menu item itself.

#nav > li {
            display: inline-block;
            margin: 0 5px;
            padding: 3px 15px;
}

By following this structure, the code will become more organized.

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

Identifying Instances of Classes with the Identical Name Using Selenium

I'm currently working on tallying up each instance of the class named product unlocked enabled. I have it set to automatically recount at intervals, increasing the count as more classes change their name. Despite conducting extensive research online, ...

"Fixing the position of a div on the Samsung Galaxy S8 navigation bar to

Here is the HTML code I am working with: <div class="app-bar"> <a href="#'>icon</a> <a href="#'>icon</a> <a href="#'>icon</a> <a href="#'>icon</a> </div>' ...

Centered Navigation Bar Aligned with Header

I'm having trouble aligning my header vertically with the text in my nav-bar using Bootstrap 4.6. The nav-bar items are right-aligned, so the text isn't centered in the middle of the page like shown in picture 3. .jumbotron { background: #3 ...

How can I retrieve dt/dd elements and store them in an array using Simple HTML DOM?

Similar Question: Retrieving data from HTML table using preg_match_all in PHP This is the HTML code snippet: <div class="table"> <dl> <dt>ID:</dt> <dd>632991</dd> <d ...

How can I retrieve HTML with JavaScript enabled?

Seeking to extract the HTML code from a webpage using PHP, I attempted the following: $url = 'http://en.wikipedia.org/wiki/New_York_City'; $html = file_get_html($url); However, an issue arose where Wikipedia failed to supply the <script> ...

Utilizing jQuery for seamless transitions between multiple background images

Looking to create a dynamic page using jQuery that alternates between different large background images for a fading effect. How can I achieve this? ...

The appearance of HTML in JSP and CSS output in a Spring application is different from the local environment

For my web application's landing page, I created the design using HTML and CSS. Typically, I first design it on scratchpad.io before implementing it into my STS IDE. However, when I run the application, the output of the page appears different from th ...

Styling emails with CSS: Tips for customizing fonts

I've been experimenting with setting a personalized font for an email. Within the HTML code of the email, I included the fonts using this snippet: <head> <style> /* latin-ext */ @font-face { font-family: &ap ...

Troubleshooting: @media query's max-width CSS property not functioning as expected

(The styling works on all browsers except Chrome) I am trying to apply a specific style only when the browser width is less than 1400px Unfortunately, using max-width is not producing the desired effect @media only screen and (max-width:1400px) { .head ...

Is there a way to obtain HTML code within a contentEditable DIV?

When working in a contentEditable-DIV, my goal is to extract the HTML code from the starting position (0) to the end position where the user has clicked. <div id="MyEditableId" contentEditable="true"> 1. Some text 123. <span style="background-c ...

Tips for achieving a slanted div design

Is there a way to create a slanted div similar to the red div shown on this website? Below is the CSS I have attempted: #parallelogram { width: 150px; height: 100px; -webkit-transform: skew(20deg); -moz-transform: skew(20deg); ...

Looking to reposition the control buttons above the slider in easySlider 1.7?

I am thoroughly enjoying the easySlider 1.7 and found it incredibly simple to implement. The only modification I wish to make is to relocate the next and previous buttons above the slider instead of below it. Does anyone have any suggestions on how to achi ...

Different ways to update background hues in Reactstrap

I am currently working on styling an application with reactstrap, and I'm facing a challenge in changing the background color of the navigation bar from white to black. I tried setting the color attribute to "dark" in the nav tabs tag, but it didn&apo ...

Tips for repositioning the window when linking to a different section of a website

As a beginner in HTML and CSS, I am currently working on adding a navigation bar to my one-page website. I want the navigation bar to smoothly guide users to different sections of the page when they click on a link. To achieve this, I am using anchors and ...

The occurrence of "Error [ERR_STREAM_WRITE_AFTER_END]" was noted when trying to write to an HTTP server in

How to set up a new http server using Node.js After launching the server, the initial HTML text is displayed correctly. However, moving to other links in the code (e.g., localhost:5001/about) results in an error appearing in the IDE console. events.js:377 ...

How to create a three-column CSS layout with a sticky footer and set the columns to have 100%

After merging two different examples: This unique layout was created. http://jsfiddle.net/xVuh5/ Although it is great, I am looking to make the 3 columns 100% height. If anyone can assist, please let me know. Thank you! Here is the body of the html an ...

Does the hoverable region extend beyond the text of the <span> element inside an <a> tag?

It appears that there is a rectangular border surrounding the text, making it also hoverable. I only want the characters themselves to be hoverable. I attempted using a 'span' element to correct this issue but it did not work as expected. a:ho ...

Guide on submitting a query to an ASP page through PowerShell

One of the pages on an internal aspx website is http://stackoverflow/answers/Requests.aspx. This page is where data is submitted through forms to retrieve results. I am seeking advice on how to submit the same query/data using PowerShell. Although I am ...

Use jQuery to remove an ID from an element using AJAX to interact with a database, then update

Hello, I am currently using jQuery to retrieve ids of multiple fields with ajax and send the data to be deleted via php. Despite being able to delete one item successfully, I am struggling to remove other ids. For example: Within a for loop that retrieves ...

Concentrating on individual text inputs is ineffective in this situation

Before we proceed, please take a moment to check out this fiddle link: http://jsfiddle.net/asif097/z6zsc What I am aiming for is to have this jQuery code execute independently for each text input with the specified class. Currently, it is affecting both t ...