Having trouble with a basic floated-DIV layout not functioning correctly in IE8

I'm currently facing a frustrating layout issue on our website that only seems to be occurring in IE (versions 7 and 8), while Firefox and Chrome are working perfectly fine. The problem is specifically happening on this particular page:

The issue lies in the positioning of the report images, which should be aligned to the left of the text. We have a simple structure set up with an outer div containing the item, then an inner div floated to the left (resourceleft) and another inner div also floated to the left (resourceright). Both of these inner divs have widths smaller than the outer DIV. Here's a snippet of the code causing trouble:

<div class="resourceitem">
    <div class="resourceleft">
        Test LEFT
    </div>
    <div class="resourceright">
        Test RIGHT
    </div>
</div>

The CSS relevant to this issue is as follows:

.resourceitem {
    margin-bottom: 10px;
    overflow: hidden;
    width: 100%;
}

div.resourceleft {
    float: left;
    margin-left: 20px;
    width: 156px;
}

div.resourceright {
    float: left;
    padding: 0;
    width: 268px;
}

Any assistance would be greatly appreciated, as this problem has become quite maddening!

Thank you, Chris.

UPDATE - Problem Solved.

Ah! After some investigation, I've discovered the root cause of the issue - it was related to my responsive linking code and how IE8's Developer Tools displayed rules that weren't actually being applied. The rules were located in the fms-res.css file, but this file is used only for browsers that understand media queries and have a width greater than 980px. IE8 utilizes a default desktop-only file called m-equiv.css, where the necessary rules were missing. The Web Developer Toolbar misleadingly showed these rules as applying from fms-res.css, even though they did not really affect the elements. This effect of Developer Tools is something we often see with print stylesheets (print.css) as well, where rules show up despite not applying unless during printing.

A huge thank you for all the input, even if the solution turned out to be quite trivial in the end.

Cheers!

Answer №1

Omit the </a> from the code snippet below as it appears to be an unnecessary addition (potentially a mistake) causing issues in Internet Explorer:

<div class="resourceleft">
    <img border="0" alt="Rio+20: Is this it?" src="http://www.foe.co.uk/imgs/Rio_-_is_this_it.png" />
    </a>
</div>

Please take note that each <div class="resourceleft"> includes an extra </a>

Answer №2

UPDATE - Problem Resolved.

I discovered the issue - it was related to my responsive linking code and how IE8's Developer Tools displayed rules that were not actually in effect. The specific rules for this situation were located in the fms-res.css file, which is only utilized by browsers with media query support and a width greater than 980px. However, IE8 defaults to a desktop-only file named m-equiv.css, where these rules were missing. Interestingly, the Web Developer Toolbar incorrectly indicated that the rules from fms-res.css applied, when they did not. This deceptive behavior is similar to what we sometimes see with print stylesheet (print.css) rules displaying in Developer Tools, despite not actually being active unless specifically printing.

A big thank you to everyone who provided input, even though the solution ended up being relatively simple in the end.

Cheers!

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

Broadcast live video on your website using VLC/Red5 or any other streaming platform of your choice

Currently, my home website is built using Java/SpringMVC web server. I am looking for a way to stream my webcam feed on my website so I can access it from any browser and see the live view of my room. If anyone has recommendations for an easy-to-use solut ...

What is the best way to create a clickable image with a box-shadow when a z-index of -1 is applied?

Is there a way to make an image clickable while still retaining the box shadow effect created using CSS3? Currently, I have set the z-index of -1 for the img tag to apply the box shadow. However, this makes the image not clickable when an href tag is added ...

A website with two distinct pages, where only the first page is refreshed

I have split the content of my HTML page into 2 separate subpages, based on the references provided below: Multiple distinct pages in one HTML file This is how my code is structured: ... <script> function show(shown, hidden) { document.getEle ...

Achieve full expansion or complete collapse in stylesheet through Java code

My goal is to compile multiple XML files into an HTML table and display the results. I utilize the xsl:elemnt command to create individual cells within the tables as shown below: <table> <col span="1" class="firstCol" /> <thead alig ...

How to include multiple lines within an HTML text box

I need help making my text box display multiple lines while maintaining the current design. I am new to HTML/CSS, so any advice on how to achieve this would be greatly appreciated! Additionally, I want to center the button at the bottom of the text box. H ...

Unable to reach the margin-left properties of the elements

I am facing an issue in accessing the current margin-left CSS property of the class .circle in the code snippet below. A demonstration of this problem can be found on a website called PLUNKr. The reason I need to access this property is because I have to ...

How can CSS and DIVs be utilized to align two smaller content boxes alongside one larger content box?

I'm trying to use CSS to create a layout with three div tags arranged in a specific way. I want two small content boxes stacked on each other, with a small space between them, to the left of a large content box. Any suggestions on how I can achieve t ...

Root links are not functioning as expected

I have been working on appending divs using Jquery to create links that navigate to various pages within my site. Currently, my website is hosted on my local computer and not online. As I prepare to transfer the files to my domain, I am encountering issues ...

Having difficulty positioning text within a div with a fixed height

I'm facing a challenge in aligning text at the center of a div. My goal is to horizontally center it, but position it slightly higher than the vertical center. The div has a fixed height of 45%. How can I achieve this layout? .galf { width : 100%; he ...

Place the div underneath the other div

I need assistance with incorporating a div layer into my project, similar to the image depicted: Upon clicking the Site List button, I aim to have the div overlay the form. Currently, I've utilized jQuery's toggle function to control the visibil ...

Is there a way to use CSS to break one word at the end of a line and move the next word to the next line?

My desired format: _________ Thanks fo|r your answ|er! not the following: _________ Thanks | for your | answer! | also not this: _________ Thanks fo|r your answer! ...

React Native presents a persistent challenge with the absolute positioning of elements

Building a react native application with a divided left and right section. The left side has flex:0.7, while the right side has flex:0.2. In the left section, there's a container with an embedded ImageBackground resembling a circuit framework. http ...

Display the contents of a JSON array in an HTML format

I have designed an exercise that requires me to display the cities corresponding to each department based on a JSON file. Currently, I am able to display the departments in their respective selections, but I am struggling to only show the cities that corre ...

Can you include an optional selector in SASS?

Here is an interesting concept: adding a CSS-selector optionally to the existing selector stack within a mixin. This is what I envision: @mixin myMixin(mobileSelector:true) { @if(mobileSelector) { .foo .mobile:before, } .classXY .subclass:before ...

Steps for deactivating a button based on the list's size

I am trying to implement a feature where the user can select only one tag. Once the user has added a tag to the list, I want the button to be disabled. My approach was to disable the button if the length of the list is greater than 0, but it doesn't s ...

Error encountered while trying to load the fonts

Upon attempting to load fonts into the Spectacle boilerplate, I encountered the following error message: Failed to decode downloaded font: http://localhost:3000/assets/fonts/Overpass-Bold.ttf OTS parsing error: invalid version tag I've includ ...

Can you code up the CSS and HTML for this design concept?

I have a design mockup that I would like to implement using CSS and HTML. I've started a JSFiddle for it, which currently consists of a table that I need help styling. <table border="1"> <tr> <td>grey</td> ...

Transform SCSS into CSS effortlessly

Within my ASP.NET project, I have both scss and css files. If I make changes to the scss file, is it necessary for the css file to be regenerated? If so, what is the most effective method for doing this? Can Visual Studio handle this task or do I need a d ...

Prevent a button on my side bar from being clicked until the user has logged in?

How can I use Django and HTML to disable a button in my tab bar until a user is logged in? This is my sidebar: <div id="mySidebar" class="sidebar"> <a href="javascript:void(0)" class="closebtn" onclick="closeNav()">×</a> <a href ...

Is it possible to automatically select a file and upload it to a specific server? If so, how can this

Hey there! I'm looking for a code snippet that allows me to automatically select a file and upload it to a specific link. Any ideas on how to accomplish this task? Here is the HTML code: <html> <head><title>Uploading</title>& ...