The media query above 851px is the only one functioning, while the rest are not operational

I'm having trouble with the media queries in my code for formatting my products page.

Currently, only the first query (for screens above 851px) is working properly.

This is how I've set up my code:

.my-prods-container{
        display: flex;
        flex-wrap: wrap;
        justify-content: space-evenly;
    }
    .my-prods{
        margin-bottom: 30px;
        box-sizing: border-box;
    }
    @media screen and (min-width:851px){
        .my-prods{
            flex-basis: 21%;
        }
    }
    @media screen and (min-width:601px)and(max-width:850px){
        .my-prods{
            flex-basis: 30%;
        }
    }
    @media screen and (min-width:401px)and(max-width:600px){
        .my-prods{
            flex-basis: 45%;
        }
    }
    @media screen and (max-width:400px){
        .my-prods{
            flex-basis: 90%;
        }
    }

Answer №1

Your implementation of media queries is impressive, but remember to always include spaces between the and.

For example:

@media screen and (min-width: 601px) and (max-width: 850px)

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

Require assistance with arranging font-awesome icons in a stacked formation

After upgrading to the latest version of font-awesome, I encountered some stacking issues with my icons. In the previous version, everything was working perfectly. <li><span class="icon-stack stacked"><i class="icon-circle icon-stack-base" ...

Positioning bar chart columns and text using CSS

My component generates HTML for a simple bar chart, with the height and background color computed within the component. Everything functions correctly, but I am facing an issue where long text causes displacement of the bar above it. Another problem is th ...

Modifying the ngFor directives in Angular for a fresh look

I successfully implemented the *ngFor feature and it's functioning properly: <div class="dummy__1" *ngFor="let item of dummy.pic; let i = index"></div> Now, I am looking to modify the class="dummy_1" to produce the following format: < ...

show tab focus outline only

In search of a straightforward and effective method for focusable elements to display an outline only when the tab key is pressed, without showing it when using a mouse in React applications. (looking for something similar to :focus-visible that function ...

AngularJS 1: Dynamically updating input values in real-time

Hey everyone, I'm experimenting with Angular and have encountered a roadblock. I am trying to assign values to an input element using ng-repeat for a list of parameters. <input type="text" ng-model="parameters.inParameterName" class="form-control ...

The unspecified value of a dynamically generated button

Currently, I am working on generating ion cards with a response. Each ion-card contains 3 buttons. I am able to receive the response properly, but I am facing an issue with assigning values to the buttons, or possibly implementing it incorrectly. Here is ...

I am struggling to create a responsive form using Bootstrap

I am facing an issue with my two forms that I want to have a fixed full-screen size. Despite trying different bootstrap options, they are not responsive at lower resolutions. What should I do to make them responsive? Here is the code: <form action=&a ...

I seem to be struggling with hiding/showing a div element. Can you figure

I am in the process of creating a gallery that will display a div with images when a button is clicked. The issue I am facing is that when I have two buttons, only the last images are clickable. It's a bit difficult to explain, but you can see it in ...

"Unleashing the fun: incorporating a variety of random songs into your

My goal is to create a central button on my webpage that, when clicked, will trigger a playlist of randomly selected songs. Once pressed, this button should vanish, giving way to an audio control window that spans the full width of the screen at the bottom ...

Click on a kendo-chip in Angular to copy its content

Can someone assist me in copying the content within a Kendo Chip when clicked in an Angular application? Your help is greatly appreciated. View image here ...

Prevent draggable function in jQuery-UI for specific elements

I'm in the process of creating a website that mimics a desktop interface, and I want to be able to easily move around the windows. To achieve this functionality, I am incorporating jQuery-UI along with the .draggable() method. My current HTML structur ...

Is there a way to prevent Django from automatically sanitizing HTML when inserting it into a template?

I'm feeling a bit puzzled about this situation because it appears that Django templates offer optional HTML filters, yet there seems to be an automatic process at play.. I am working on creating a demo app where the user triggers an action that execut ...

What is the best way to incorporate transition effects into images as they appear on the screen?

I'm currently working on my React app and trying to add effects to images when they appear on the page. I have tried using the code below, but it doesn't seem to work as expected. I directly applied styles to the div tag because I couldn't g ...

Transferring data from HTML label to TypeScript

Looking for some assistance with this code snippet: <sh-toggle label='ABCD' id = 'ABCD'> </sh-toggle> I am trying to extract the value of the label in my TS file. Can anyone provide guidance on how this can be achieved? Whe ...

displaying variables in tooltips along with their translations

Could you please assist me with this tooltip issue? It seems to be malfunctioning. <div class="btn-edit-nounderline" matTooltipClass="custom-tooltip" (click)="edit(row.widgetAccess)" title="{{getTitle(row.widgetAccess ...

react-datepicker displaying error message "Preventing default action not possible within a passive event listener invocation"

I've integrated the react-datepicker library in portal mode. While it functions well on browsers, I encounter an error when using mobile browser mode. An issue arises stating: "Unable to preventDefault inside passive event listener invocation" Des ...

Adding variables to a div using jquery

Is there a way to use jQuery to append variables to a div? Below are my codes, but I am looking to display div tags in the append. For example: .append("" + p + "") var image = item.image; var label = item.label; var price = item.price; ...

The slider feature is not set to automatically slide on its own

I need help creating a JavaScript slider that includes next and previous buttons. The functionality for these buttons is working properly, but I also want the slides to transition automatically. <link rel="stylesheet" href="http://www.w3schools.com/l ...

The button in the flex container is not wide enough due to center alignment

For my project, I implemented a CSS grid layout consisting of 20 rows and 20 columns (5% of screen for each cell). One particular page includes a button that initially fit within grid columns 5-8 and rows 6-9 without any issues. However, I wanted to center ...

Issue encountered with sortable table in list.js

Encountering a puzzling error while implementing list.js and tabletop for a sortable table sourced from a Google Doc. The error message reads: "Uncaught TypeError: Cannot read property 'childNodes' of undefined," pinpointing the first line in lis ...