Using a 90% zoom level in the browser does not trigger any media queries

When addressing the width of a specific class, I utilized CSS media queries as shown below:

@media (max-width:1920px) {
    .slides {
        width: 860px;
    }
}
@media (max-width:1500px) {
    .slides {
        width: 852px;
    }
}
@media (max-width:1280px) {
    .slides {
        width: 850px;
    }
}
@media (max-width:1097px) {
    .slides {
        width: 680px;
    }
}
@media (max-width:960px) {
    .slides {
        width: 540px;
    }
}
@media (max-width:768px) {
    .slides {
        width: 410px;
    }
}

Despite these media queries working fine from a browser zoom level of 500% to 100%, they stop being applied once the zoom level is set to 90%. Why is this happening and what mistake am I making?

Answer №1

When your page is zoomed in at 90%, it likely exceeds 1920px, rendering your queries ineffective without a default case. One solution is to add the following CSS before your media queries:

.slides {
    width: 960px;
}

Remember to adjust the width of .slides as needed for screens wider than 1920px.

On a 1920px monitor at 90% zoom, the page's width reaches approximately 2133px. At 50% zoom, it expands to 3840px and so forth...

To make your .slides responsive based on viewport width, consider using vw (1vw = {viewport width}/100). For instance, setting .slides to 50vw will ensure it occupies 50% of the viewport width regardless of zoom level (unless overridden by a stronger rule):

.slides {
     width: 50vw;
}

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

What causes the CSS `resize` property to be inherited in Chrome browsers?

It was my understanding that elements do not inherit the resize property from their parent elements. However, I recently discovered that in Chromium they actually do: Here is a screenshot of Chromium's inspector: Check out this demo: http://jsfi ...

What steps can I take to prompt this function to modify the value of my input?

After recently delving into the world of JavaScript, I decided to create a background color generator that randomly changes when a button is clicked. This simple project involves two input fields (color1 & color2) which receive random values upon clicking ...

Tips for aligning the text of a button and placeholder vertically

I am facing an issue with centering placeholder/input text and button text vertically on my website. I used Bootstrap to create the site and utilized its input and button classes, but I couldn't figure out how to achieve vertical alignment. I tried ad ...

Endless cycle of changing border colors

I'm trying to achieve a specific effect where the border of a div changes colors in an infinite loop. However, I want this effect to be applied only to the border of the div and not the entire body background. Here is an example: http://jsfiddle.net/A ...

"The issue of the search form CSS class loading twice and causing placement issues following the completion of the AJAX

I implemented a search form that fetches data from the server and displays it in a div, which is working smoothly. However, when I added an ajaxComplete function to add a class for animating the results, it resulted in unexpected behavior. Upon entering t ...

Can we expect every bullet point to be consistently indented at precisely 1.8em?

Recently, I created a dropdown menu using only CSS. The challenge was to have a horizontal bar of items that can each expand into a vertical menu. However, I wanted the expanded menus to display bulleted lists instead of tertiary menus. By nesting three ul ...

Label alignment in one line with responsive checkbox

Could someone assist me with adjusting the alignment of this checkbox when resizing the window for mobile view? The label text is breaking into a new line while the checkbox remains in its original position. How can I make the checkbox align closer to its ...

Using HTML and CSS to create interactive icons that change color when clicked, similar to how a link behaves

Have you ever wondered if there's a way to make an icon act like a link when clicked, just like regular text links turning purple? And not just the last one clicked, but every single icon that gets clicked. Trying to use the :visited pseudo was unsucc ...

Unable to view numbers on iPhone or ios device

I am facing an issue with displaying a phone number in the contact section on my website. The number shows up on desktop but not on my iPhone, even when I resize the screen to be smaller than my phone's display size. This issue has been tested on both ...

Customizing Material-UI Grid: Is it possible to assign a background color solely to the cells, without affecting the surrounding empty spaces?

I've been experimenting with designing a grid system that incorporates a gradient background color. The issue I'm facing is that the background color extends to the empty spaces between the grid cells as well. Is there a way to scope the gradient ...

Update the default monospaced font in Draft.js

Is it possible to change the default system monospace font in Draft Editor to Consolas using Draft.css or global css classes? ...

Strategies for properly formatting a second line indent on lists with background bullets

I've set up an unordered list with bullet points created using FontAwesome, along with a background and border radius for added style. My issue is that I want the second line of text to align below the first one rather than under the bullet point. ...

How to harness the power of loops in JavaScript

Having trouble getting this code to repeat a CSS transition properly. for (var i=0 ; i<4 ; i++){ setTimeout(function() { $('#top-left').css('margin', '45px 0 0 45px'); $('#top-mid' ...

Moves are chosen to move downward when positioned next to an inline-block level element

Check out this jsfiddle example How can I prevent selects from moving down when there is an inline-block level element next to it? <select> <option value="" >Day</option> </select><select> <option value="" >Mon ...

Accordion section appears on the webpage as it is loaded

I am currently working on implementing an accordion feature for my webpage. Everything is functioning correctly when I click the button, but there is one issue - the div opens automatically when the page loads. My goal is to have the div closed initially a ...

Exploring the implications of Content Security Policy in conjunction with mod_pagespeed evaluations

I am currently in the process of configuring CPS rules for my website. One issue I have encountered is that mod_pagespeeds often uses 'unsafe-eval' for scripts, which goes against my security settings. An example of code generated by mod_pagespee ...

Issue with margin-top in combination with clear:both does not function as expected

<div style="float: left;">Left</div> <div style="float: right;">Right</div> <div style="clear: both; margin-top: 200px;">Main Data</div> What is causing the margin-top property to not work as expected for 'Main Dat ...

Are there any tools available that can convert inline styles into CSS classes?

Can anyone recommend a package that will transform this text: <p style="width: 500px; height: 500px"> Hello World </p> into this format: <p class="foo"> Hello World </p> .foo { width: 500px; height: 500px; } ...

Having issues with a Retina iPhone interacting with a website built using responsive Twitter Bootstrap

I'm currently utilizing Twitter Bootstrap alongside responsive CSS for a web page that is optimized to run in a UIWebView. My goal is to ensure the consistency of the page's appearance across all iPhones, with an exception for images. These imag ...

The two divs are positioned on top of one another, with the link in the bottom div being unclickable

I am trying to create a unique effect where a tile divides into two on hover, with each tile acting as an individual link. Additionally, I want the background color of the tiles to change on hover. To achieve this, I have stacked two divs (toptile and bot ...