Floating elements in IE are dropping below a floated input within an unordered list, while in Chrome everything displays correctly

I've been troubleshooting this issue for an hour now with no success. I'm facing a problem in Internet Explorer and can't figure out why.

This is a snippet of the HTML code I'm using to display my registration form:

<ul id="register_form_list">
    <li><label for="register_full_name" class="register_label">Full Name</label></li>
    <li class="input_wrapper">
        <input type="text" class="register_text_input" name="full_name" id="register_full_name" value="">
        <div class="register_field_help">
            <span class="register_field_error_text" style="display: none">Enter your first and last name</span>
        </div>
            <div class="register_field_error">
        <span class="register_field_error_text">Please enter your full name</span>
    </div>
    </li>
</ul>

Below is the CSS code that styles my registration elements along with their corresponding tooltips:

ul#register_form_list { float: left; clear: left; margin: 25px 0 0 29px; width: 670px; }
ul#register_form_list li { float: left; clear: left; display: inline; margin-left:0px; }
ul#register_form_list li.input_wrapper { padding: 0 0 15px 0; }
label.register_label { float: left; font-size: 0.9em; font-weight: bold; color: #093C5D; text-decoration: none; }
ul#register_form_list input.register_text_input { float: left; clear: left; margin: 6px 0 0 0; padding: 5px; width: 260px; border: #B0B0B0 1px solid; background: #FFFFFF url(images/quizmaker/field_shadow_bg.png) repeat-x; background-position: top; outline: none; font-family: Arial, sans-serif; }
ul#register_form_list input.register_submit { float: left; clear: left; margin: 0 0 0 0; padding: 5px 14px 5px 14px; }
div.register_field_help { float: left; display: none; margin: 0 0 0 6px; width: 386px; height: 39px; background: url(images/welcome/register_text_help.png) top left no-repeat; }
span.register_field_help_text { float: left; margin: 10px 0 0 20px; color: #FFFFFF; }
div.register_field_error { float: left; margin: 0 0 0 6px; width: 386px; height: 39px; background: url(images/welcome/register_text_error.png) top left no-repeat; }
span.register_field_error_text { float: left; margin: 10px 0 0 20px; color: #FFFFFF; }

The issue I'm facing is that the tooltip elements of div.register_field_error are appearing below the input fields instead of beside them as intended.

Interestingly, everything appears to be working perfectly in Chrome. The tooltips fit within the width of the ul (670px), but in IE, I have to increase the width of the ul to 733px or more via developer tools to get them to display side by side.

You can view the live code here. Just click 'Register' without filling in any inputs, and you'll see the tooltips next to each input field.

It almost seems like there's some right-hand padding on the UL causing this issue, but setting margin:0 and padding:0 on the UL hasn't resolved it.

The problem seems to occur when emulating IE7 in IE11. I need the site to function properly in IE7.

Answer №1

After ditching floats, I have found them to be unnecessary and troublesome for most layout designs. Instead, I have adopted using display: inline-block and display: table which provide a more efficient way to achieve the desired layouts.

I have made the decision to eliminate the use of 'float' and 'clear' from my CSS stylesheet, except in cases where I need text to wrap around an image. It seems that this is the original purpose of the float property.

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

Choosing the right framework for implementing push notifications can be a critical decision. Should

I am currently working on a Java application that requires the server to send push notifications to the client every one second. To achieve this, I am using HTML5 server-sent events for one-way communication from the server to the client. However, my conce ...

Scroll within the inner container

I am currently working on creating panels, each with a header and content. My goal is to allow scrolling only within the content area. Here is the CSS I have been using: .content-div{ float:left; height: 400px; overflow-x:hidden; overflow-y:hidden; ...

Locating Elements with Python 3 and Selenium: Unraveling the xpath Mystery

https://www.facebook.com/friends/requests/?fcref=jwl&outgoing=1 I am looking to click on the "See more request" option within the "friend request sent" section. <div id="outgoing_reqs_pager_57b87e5793eb04682598549" class="clearfix mtm uiMorePager ...

Troubleshooting a dysfunctional Vue.js component

I am currently facing a challenge in getting components to function properly. Interestingly, without the component, everything seems to be working fine (as per the commented code). Here is my HTML snippet: <strong>Total Price:</strong> <sp ...

The art of arranging elements on a webpage using HTML and

I designed a rectangle using position: relative; and placed an icon inside it. However, when I added a new div class called .Home, and included an element <h4>Home</h4> with position: relative;, the element appeared outside of the rectangle. Wh ...

Using Reactjs Material UI Table component results in grid expansion

I'm facing an issue with my Table component nested inside a Grid component. Whenever the Table component is rendered, it causes the Grid component to expand in width. I want the Grid component to maintain its original width when the Table component is ...

Tips for effectively utilizing an if/else structure to animate fresh content from the right while smoothly removing old content by sliding it to the left

document.getElementById("button1").addEventListener("click", mouseOver1); function mouseOver1(){ document.getElementById("button1").style.color = "red"; } document.getElementById("button2").addEventListener("click", mouseOver); function mous ...

tips for remaining in modal window post form submission

I have a form within a modal window. I am using ajax to load content in the same modal window, but the issue is that it redirects to the main page after submitting the form. How can I ensure that the modal window stays open even after the form submission? ...

Adjust the child content within a React component based on the element's width, rather than the overall window size, by implementing dynamic resizing without fixed breakpoints

I am working with a react component that displays a div containing menu items which are aligned horizontally using inline-block. The menu items have text labels "Toy Store", "Configure your Toy", and "About Us". My challenge is to dynamically change the ...

Looking for an element that includes "== $0" right after the closing tag in HTML can be done using Xpath, CSS, or any other locators in Selenium with Python

a link to an image <div class=""><div>Mumbai, Maharashtra</div></div> Take a look at the above example for guidance. I attempted to use the code below but it failed to produce results: driver.find_element(By.XPATH,'//di ...

HTML: The art of aligning elements within a header

I've been working on creating my personal HTML record, but I'm facing one last challenge that I can't seem to overcome. I want to design my header like this: https://i.stack.imgur.com/FU8EJ.png With the following elements: TEXT SUMMARY wi ...

Is It Always Necessary to Specify a Width and Height for an Image?

Is it necessary to specify both the Width and Height of an image on a webpage for consistent display across all browsers, or is specifying just one sufficient? While it may appear fine on certain browsers, I want to double-check for accuracy. Appreciate ...

How to efficiently remove duplicate items from multiple select dropdowns in Angular using ng-repeat?

Need help with dynamically assigning objects to select boxes in AngularJS. I have a scenario where I add multiple select boxes to a form, but each box should only display items that haven't been selected in other boxes. How can I achieve this functio ...

The issue with anchor links not functioning correctly in Chrome's desktop browser has been identified

I am interested in utilizing the greenfair CSS template available at this link. However, I have encountered an issue where the anchor links in the navbar do not work properly in Chrome (they function correctly in Firefox and IE). How can I resolve this pro ...

Having trouble retrieving values from multiple checkboxes in HTML

I have a HTML table displaying all the items from my SQL database. Each item has a checkbox that is supposed to pass the value of the item name to the calculation route when the submit button is pressed. However, the issue is that the submit button only ...

Leveraging both onmouseover and onmouseout for container expansion

My goal is to utilize JavaScript along with the HTML events "onmouseover" and "onmouseout" to create a dynamic container. Essentially, I want the container to act as simply a heading when the mouse is not hovering over it, but expand to display additional ...

Looking to bookmark Java links or a similar task?

Apologies for the lackluster title, as I am not well-versed in programming language and struggle to articulate my specific request... Allow me to explain: I frequently need to visit a particular website to conduct research (details below). I attempted usi ...

Utilizing CSS nested spans and setting custom width attributes

I'm curious about how nested spans and CSS handle the width attribute. In the HTML code provided, the 'wide' class sets the width while the 'box' class adds a border. I've noticed that the width is only applied when both class ...

The href link on Android and iPhone devices is not activating, instead showing a focus rectangle

I've encountered an issue with the responsive layout of my HTML5 site on Android and iPhone versions. The links on the site are behaving strangely - they only work if I hold them down for a full second. Otherwise, they act as if a hover event is trig ...

Issue with JavaScript Onclick Event Handler

Rephrasing Full JavaScript Code. Javascript <div id="PopUp1" style="display: none; color: #FFFFFF;"></div> <div id="Mask"></div> <script type="text/javascript"> var Content = '<p>Content!!!!!</p><input ty ...