My columns are failing to utilize 100% width in conjunction with @media at 320px

Hey there, I'm in the final stages of completing my website but I'm encountering a slight issue with the columns not displaying at 100% on mobile devices. I've included the CSS below, but for some reason, the max-width of 320px isn't causing the column to go full width on mobile.

Feel free to visit the site to see the problem firsthand:

I'm sure it's an easy fix...any help would be greatly appreciated!

@media(max-width : 320px){
.column.half { width: 100%;}
 }

/* Column sizes */

@media (min-width: 40rem) 
 .column {
float:left;
padding-left:1em ;
padding-right:1em;
}

.column.full { width: 100%; }
.column.two-thirds { width: 66.7%; }
.column.half { width: 50%;}
.column.third { width: 33.3%; }
.column.fourth { width: 25%; }
.column.flow-opposite { float: right; } 


/* Column sizes end */

/* Medium screens (640px) */
@media (min-width: 40rem) {
html { font-size: 112%; }
.third {  float:left; display:inline;}
.half {  float:left; display:inline;}
.two-thirds { float:left; display:inline;}
.image {  border-style: double; border-color:white;} 
}

/* Large screens (1024px) */
@media (min-width: 64rem) {
html { font-size: 120%; }
}

Answer №1

Ensure to place this condition at the end as it may get overridden by the default width setting.

.column.half { width: 50%;}

@media(max-width : 320px){
    .column.half { width: 100%;}
}

Answer №2

It is important to take note that the "half" class will stop floating left at 640px. The issue may have originated from there, as devices with larger screen resolutions could be affected. It might be beneficial for you to consider changing the threshold from 320px to 640px:

@media (max-width: 40rem){
    .column.half
    {
        width: 100%;
    }
}

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

How come my donut graphs are sitting outside the box while all other types of charts are properly aligned?

I am encountering an issue with my charts where all of them are positioned in the center of a div when drawn by the user, except for the donut charts. They seem to be placed outside of the top-left corner instead. Can anyone provide insights as to why this ...

Tips for maintaining an open side menu

I'm having trouble keeping the side menu open when a user clicks on one of the child menu items. Ideally, I want section 1 to display section 2 content when hovered over, and keep both sections open even when section 2 is clicked. The only time they s ...

Attempting to link together an input box and the value it holds

I am attempting to combine an input box with a bound value. I have placed an asp label inside a column so that I can bind the value below it. <tr> <td style="font-size:large"><b>Standard Sizes & Tolerances</b></td>< ...

Using JQuery to ensure the validity of each input inside a form

I am looking to implement the same jQuery validate rule across all input fields with the name "time" within a table that is part of a form. Here is the HTML code: <form id="thresholds"> <table id="table" width="100%"> <thead> ...

What is the reason for the disappearance of unordered list bullets when using padding: 0?

Updating an older website that contains numerous unordered lists has presented a challenge. When the padding is set to 0, the display markers on the unordered list disappear. The root cause of this issue was traced back to the CSS setting *{padding: 0; ma ...

What is the best way to keep the heights of two divs in sync?

Is there a way to make two divs have the same height, even though their content determines their individual heights? I am looking for a solution that doesn't involve using a table or a parent div. I'm new to JavaScript, so I'm hoping there i ...

Exploration of JavaScript Interview Questions

I need help creating a JavaScript function that will be triggered on button click, but instead of targeting the button directly, it should target a div element by its class. How can I achieve this? <body> <div class="content"> <butto ...

What is the reason for attempting to use "gethostbyaddr" to convert an IP Address to a Hostname and finding that it does not function as expected

My attempt to convert an IP Address to a Hostname using "gethostbyaddr" is not working as expected. I am analyzing a log file called file.text to determine which pages users are frequenting the most or least. To achieve this, I am trying to extract sentenc ...

Adjust the width of a div to be the same as another

I am working with an HTML layout that includes the following elements: <div id="header"></div> <div id="body"></div> <div id="footer"></div> When the header has a fixed width, how can I make it stretch to match the w ...

Different approach instead of using margins for HTML email design

Is there a way to replace the following in an HTML email: margin-top: -40px; This code works well in Webmails but not in Outlook! I have tested it on different versions of Outlook and always get the same results. *I need this to position a second tab ...

Ensure that both the bootstrap buttons and images are aligned correctly on top of the divs

I am struggling to align three buttons vertically on top of two divs that fill the page. Currently, I can only position them horizontally, and my attempts to center them have not been successful. I have tried various methods like flex, changing positions, ...

- increase clarity and readability- separate sections for better

I'm working on a code snippet to showcase 4 buttons: #buttons { text-align: center; padding-top: 4%; } #buttons img { display: inline-block; list-style: none; padding: 10px; } #buttons p { color: #fff; font-family: ; font-weight: ...

Attempting to display an HTML image utilizing data storage

I'm currently working on building a database for animals at an animal shelter. I have created tables containing species information and when a user selects a specific species, all available animals are displayed. Now, I want users to be able to click ...

Ways to make the sole element you've designed fade into view

I have a function that creates a note in the DOM. The issue is that when the note is created, it adds the "fade in" animation class to all notes instead of just the one being created. How can I modify it so that only the newly created note will have the ...

Retrieve the information from the API and populate the tables with the data

I'm currently working on fetching API data and displaying it in tables, using mock data for now. Successfully implemented actions and reducers. Managed to call the API but encountered an issue with network calls where I see a blocked response content ...

What is the best way to exclude any external CSS stylesheets from affecting a particular component within a complex project?

I am struggling to isolate the tailwind CSS in a large project. Initially, I had two products with their CSS, and later added a third product with tailwind styling. Now, I am facing issues trying to exclusively use the tailwind CSS while disregarding the ...

What is the best way to center an image that is contained within a script and lacks a parent element?

I am struggling with centering the image that appears after clicking on a cropped image in my image gallery. Here is my current code: https://i.sstatic.net/9QX7d.png https://i.sstatic.net/uf6AG.png The images below showcase my issue: <!DOCTYPE ht ...

Is it possible to refine an HtmlNodeCollection by the content of a specific child element's InnerText?

I am working with an HtmlNodeCollection named var searchResults that I extracted from a website using HtmlAgilityPack. Below is a snippet showing 3 Nodes from the collection (there are more of course): /* HTML code snippet here */ My goal is to filter ou ...

How can I show/hide a div based on checkbox click on my website? It works in jsFiddle, but not on my actual site. Any suggestions?

Is there a way to show or hide a div based on a checkbox click? I've got it working in jsFiddle, but for some reason, it's not functioning properly on my website. Any thoughts on how to fix this? My goal is to offer multiple payment methods (cre ...

The position of the legend in Amchart remains unchanged

Dealing with the issue of chart size when there is a large legend can be challenging. I came across an article that addresses this problem: Putting a legend outside the chart area. However, the downside to this solution is that it restricts placing the leg ...