Fluid, Responsive Design with Collapsible Content

My responsive design is relatively new to me, and it includes a series of fluid images in the main content area. When the screen size is below 800px, this area displays one large image that spans the full width, followed by two columns of images:

body.our_work #work ul {
    list-style: none;
    margin: 0%;
    padding: 0%; }

    body.our_work #work ul li {
        float: left;
        margin: 0% 1.075268817204% 1.075268817204% 0%; /* 10/930 */
        position: relative; }

        body.our_work #work ul li.small {
            width: 49.462365591398%; /* 460/930 */ }

            body.our_work #work > ul > li:nth-child(odd) {
                margin-right: 0%; }

When the screen size reaches or exceeds 800px, the content area transforms into a row with one large image and one small image, followed by rows of three images each:

@media screen and (min-width: 800px) { 

    /* Convert to 3 Columns */
    body.our_work #work ul li { 
        margin: 0% 1.075268817204% 1.075268817204% 0%; /* 10/930 */ }

        body.our_work #work > ul > li:nth-child(odd) {
            margin-right: 1.075268817204%; }

        body.our_work #work ul li.large {
            width: 66.129032258065%; /* 615/930 */ }

        body.our_work #work ul li.small {
            width: 32.616487455197%; /* 303.3333333333333/930 */ }

        body.our_work #work ul li.large + li.small {
            margin-right: 0% !important;
            width: 32.795698924731%; /* 305/930 */ }

        body.our_work #work > ul > li:nth-child(5) {
            margin-right: 0% !important; }
}

Occasionally, about 20-30% of the time, this content area collapses and does not span the full width as intended. The layout remains correct, with one large and one small image in the first row and three images in subsequent rows.

I suspect that this issue is caused by the browser struggling to determine the size of the content area due to the fluid nature of the images.

To add to the confusion, inspecting the HTML in Chrome or Safari, or interacting with the content, sometimes triggers the content area to expand to its proper size. Additionally, resizing the window even slightly can fix the sizing issue.

Note that I do not encounter this problem on iPhone, iPad, or Kindle Fire devices.

Any assistance would be greatly appreciated.

jsFiddle: http://jsfiddle.net/p8n9W/

Update 1:
- The issue does not seem to occur in Firefox.
- The layout consists of a fixed sidebar with a fluid second column.
- When the problem arises, the width of the content area appears to match the width of the heading "Our Work".

Answer №1

It has been discovered that the problem arose from floating the fluid column in a layout comprised of one fixed column and one fluid column. When the fluid column was floated to the left, it resulted in the collapse of the column under specific content circumstances.

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

Using z-index to position the toolbar in a unique way

I have a question regarding the proper positioning of one div over another in a specific scenario: Currently, I am working on creating a toolbar for .col-9.h-100 from my code snippet. My goal is to have this toolbar appear over .col-9.h-100 when clicked b ...

Exploring the power of Vue element manipulation

I'm diving into the world of web development and starting my journey with Vue on an online learning platform. Check out the code snippet below: <div id="app"> <form @submit.prevent="onSubmit"> <input v-model="userName"&g ...

Template Function Problem Detected in AngularJS Formatting

I'm struggling to incorporate my scope attributes into a template function within my custom directive. The formatting for the return section in my template is not working as expected. This is how it currently looks: angular .module(' ...

Conceal the standard style class of the p:selectOneRadio element

On my xhtml page, I've implemented p:selectOneRadio. However, I'm struggling to remove the default style class .ui-helper-hidden-accessible, resulting in the radio button icons not being visible. Here's a snippet of my code: <p:selectOne ...

What is the way to action an image if it doesn't have an ID and is part of a dynamic numeric system

Is there a way to automatically delete a file in order to keep things clean? <img src="/images/delete.jpg" class="pointer" alt="delete" title="delete" onclick="DeleteThis('[stable number]', '[dynamic file number]')"> The dynamic ...

Is it possible to swap the src of the Next.Js Image Component dynamically and incorporate animations in the

Is there a way to change the src of an image in Nextjs by using state and add animations like fadein and fadeout? I currently have it set up to change the image source when hovering over it. const [logoSrc, setLogoSrc] = useState("/logo.png"); <Image ...

Hiding elements in HTML with React when data is null

Is there a way to hide elements using classes like "d-none" when the data is null in React? <span className="product__tag">{prod.tag1}</span> <span className="product__tag">{prod.tag2}</span> <span classN ...

Utilizing NgStyle and Property Binding in Angular to Manipulate Data (or a Different Approach)

Currently, I am diving into Angular programming and encountering an issue with property bindings. Let me share a snippet of my code: // TS FILE data[ {"id": "1", "name": "tester", "rev": "1"}, {"id": "2", "name": "tester", "rev": "1"}, {"id": "3", "name" ...

Placing the Cloud Icon at the Center Right of the Navigation Border Background

I am in the process of creating a vertical navigation bar and I have the intention to include a cloud icon that is centered at the right border, positioned directly on the background line. <nav> <ul> <li><a href="#"> ...

How can I position the hyperlink inline with the font-awesome Icon?

Hey everyone, I'm having some trouble creating a top info bar in Bootstrap 4.1.3 with Font-awesome 5.5. I want to include essential details like phone number, email address, and social icons, but whenever I try to add a hyperlink after the icon, it dr ...

Achieving a layered effect with elements overlapping onto another div

Looking for a way to create a design where the text in id="text-field" overlaps with id="image-field". Need some guidance on how to achieve this effect. Any help is appreciated. <!DOCTYPE html> <html> <body> <div class=" ...

How come the information isn't being transferred between components?

Is my method correct if I want to pass the this.prompt() function from TitleBar to Portfolio? This is what my index.html file looks like: var TitleBar = React.createClass({ render: function() { return( <div className="jumbotron"> ...

flexible navigation bar with Bootstrap

I'm currently using Yamm with Bootstrap, but I'm encountering an issue where I need to make it flexible so that each list item will have the same spacing as the others. Additionally, I want to be able to add new list items in the future without d ...

How to style multiple tags using CSS

Is there a way to style specific tags in CSS? <style type="text/css"> [attribute*="test"] { background-color: red; } </style> However, this method does not seem to work for the following tags: <test-1> </test-1> <t ...

The changes I make to my CSS file are not reflected on my website

Here's my issue: I had an HTML file and an external CSS file, both successfully linked. Changes I made in the CSS file were reflected on the website until suddenly they weren't. I tried commenting out code, refreshing the page, restarting the se ...

Tips for combining text and variable outcomes in printing

I created a calculator that is functioning correctly and displaying results. However, I would like to include a text along with the results. For example: You spent "variable result" dollars in the transaction. Currently, the results are shown only after ...

Occasional issue with the drop down menu not appearing correctly

I'm experiencing some difficulties with displaying a dropdown menu. Check out the fiddler link for reference: http://jsfiddle.net/GxrSk/ Below is the simplified HTML code: <nav> <ul id="top-menu"> <li class="parent"> ...

When the parent element has a fixed position, the child element will no longer maintain its floating property

I'm currently working on a fixed navigation panel that sticks in place while scrolling down. Here is the code I have so far: <header> <a class="logo" href="/">Logo_name</a> <nav> <a href="#">Menu_1</a& ...

Enhance the slider's worth

Hey there, just wanted to mention that I didn't write this code myself. Another person did, and I'm a bit lost trying to figure out how to assign values to the three sliders. I don't want a default value; I want each slider to take its value ...

Is there a way to verify if an HTML popover is currently displayed?

Is there a method using JavaScript to determine if the popover is open when utilizing the new popover API? <button popovertarget="pop">Trigger the popover</button> <div popover id="pop">This is the content of the popover!</div> ...