show: alongside move: towards the left

Reviewing some vintage CSS code from 2008, I stumbled upon the following CSS snippet for a menu/navigation:

#menu li {
    display: inline;
}



#menu a {
    display: block;
    float: left;
    height: 32px;
    margin: 0;
    padding: 18px 30px 0 30px;
    text-decoration: none;
    text-transform: capitalize;
    background: url(images/img03.jpg) no-repeat right top;
    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: 12px;
    color: #FFFFFF;
}

HTML:

<div id='menu'>
            <ul id='main'>
                <li class='current_page_item'><a href='#'>Homepage</a></li>
                <li><a href='#'>Products</a></li>
                <li><a href='#'>Services</a></li>
                <li><a href='#'>About Us</a></li>
                <li><a href='#'>Contact</a></li>
            </ul>
            <ul id='feed'>
                <li><a href='#'>Entries</a></li>
                <li><a href='#'>Comments RSS</a></li>
            </ul>
        </div>

Result: https://jsfiddle.net/wrsdh7yj/1/

I'm puzzled by the initial setting of list items to inline, followed by making anchor tags block and floating them to the left.

An elucidation would be greatly appreciated.

Please note that the background colors were added for visualization purposes.

Answer №1

Using the style rule display: inline helps to eliminate the staircase effect/bug in IE7.

Check out the image display difference when display: inline is not applied in an emulation of IE7.

https://i.sstatic.net/4HnRT.png

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

Performance Issues Arise with Rapid Clicking [jQuery]

Having trouble with a gallery script I created that includes thumbnails, a large image, and navigation arrows. When you rapidly click on thumbnails or arrows during the transition, it causes delays in the process. The more clicks you make, the more noticea ...

CSS-only method for creating a fixed position sidebar with adjustable width

https://i.stack.imgur.com/e4Gsv.png I have a vision of creating something similar to the image above solely using CSS. The design must incorporate the following elements: The image-container will hold a 3x4 aspect ratio image, filling the available heig ...

Eliminate Video Time Indicator

Can the video progress bar be removed from this specific video player? I would like it to be integrated into the embed code that I share with others. <iframe id="hapyak-player-157199-8825" marginwidth="0" marginheight="0" frameborder="no" scrolling=" ...

Retrieve the values and IDs for every span element within the form

I have been attempting to retrieve all span elements within a form and make them editable input text fields. Once you click away, they should revert back to span elements. I will provide a live example in the attached fiddle. I tried my hand at it, but the ...

Guide on how to smoothly navigate through an HTML page to a specific anchor point

Is there a way to use JavaScript to make the browser scroll the page to a specific anchor? In my HTML code, I have set either a name or id attribute like this: <a name="anchorName">..</a> or <h1 id="anchorName2">..&l ...

Generating a Popup Alert with a DIV

Looking at this instance: HTML / CSS Popup div on text click I am curious about how to have this display on the main page upon initial visit to the website. I prefer it to load automatically without requiring a button click, and once the content is read, ...

Comparing a datetime string from HTML with a datetime object in Python: Best practices

I am currently using selenium to extract videos, and my goal is to create a function that verifies whether the video's posting datetime occurred prior to yesterday. I am encountering challenges when it comes to comparing the extracted datetime with ye ...

Using AJAX in JavaScript within an HTML document is a valuable skill to have

I have the following JavaScript function that I need to call the /print2 function without clicking any buttons. I attempted to use Ajax for this, but I am new to Ajax and JavaScript. Can you help me identify where the issue might be? Thank you... <scr ...

CSS - Customizing the appearance of consecutive child divs

I'm struggling with adjusting the margin between two child divs when they follow each other. The current margin is set at 3rem, but I want it to be 1rem if both child containers have the class "narrow": Is there a way to achieve this without changing ...

Using @at-root seems to be causing an error when combining the "a" selector with

I encountered an issue when attempting to use @at-root and Interpolation in my Sass code. Despite using a standard example for testing, I still receive an error: .button { @at-root a#{&} { color: green; } } Error sass/Site.scss (Line 28 of s ...

Tips for opening a new browser tab

I'm having trouble getting my code to open in a new browser tab. Can someone help me figure out what's wrong? function getWaterMeterList() { // alert("ON"); var BillingPeriod = $('#BillingPeriod').val(); $.ajax({ ur ...

Solving the CSS Trick: Responsive Data Table (featuring inline editing) Display Glitch

In my quest to create a responsive table with inline editing, I turned to Chris's guide at CSS-Tricks (check it out here). To see how it all comes together, take a look at this Plunker demo. On mobile screens, the responsiveness is on point. https: ...

Serving static files in Django

Currently diving into Django and encountering a hurdle with static files. I've followed the setup in both the settings and HTML, but unfortunately, they are not loading on the website. Seeking assistance to resolve this issue! **settings.py:** STATIC ...

Transferring data from a form to a function in JavaScript

Hey there! I've been working on a form that sends a value to a new window, but for some reason, the value val2 is showing up as null in the new window instead of being passed. Here's my code: function sendValue(value) { ViewImg = window.ope ...

Adjust the href attribute of a link dynamically using the value input from a text field immediately

Is there a way to dynamically change the href attribute of a link when a user types in an input field? And is it possible to detect when a user pastes content into the input field as well? Would appreciate any suggestions on how to accomplish this using j ...

ControlOrbiter - limit panning motion

Is there a way to restrict the camera's panning movement within a scene? I've experimented with adjusting the pan method in orbitControls, but I'm not completely satisfied with the outcome. I am hoping for a more convenient and proper solut ...

When `focus` is bound to a jQuery event handler, the behavior of the select element becomes erratic on

What causes the odd behavior where users need to click twice on a select-option for it to drop down/up after binding an eventhandler to the focus event using jQuery? $('input, select, textarea').focus(function() { $(this).addClass('input_ ...

Implementing a Javascript solution to eliminate the # from a URL for seamless operation without #

I am currently using the pagepiling jQuery plugin for sliding pages with anchors and it is functioning perfectly. However, I would like to have it run without displaying the '#' in the URL when clicking on a link like this: www.mysite.com/#aboutm ...

Displaying data in an HTML table using PHP and adding a popup

I've successfully created a PHP script that retrieves data from a MySQL database and organizes the results into an HTML table. Within one of the fields in the database, there are links to file(s), separated by commas. Everything is working well thanks ...

Can you choose the class that has not yet been seen before?

Imagine a scenario where the following code is present: <div class="a"> <div>1</div> <div>2</div> <div> <div> <div class="b">3</div> </div> ...