How zoom out increase the screen width? - css

I have laptop screen with resolution 1366*768 pixels , that mean screen width is 1366 pixels and height is 768 pixels , that is fixed when i set my screen resolution to 1366*768, If i have a webpage which have css property
#media screen and (max-width:1366px){
//css1
}
#media screen and (min-width:1361px) and (max-width:1500px){
//css2
}
That mean if device 's screen has a width of 1366px or lesser css1 will apply to that page , and if the screen is larger than 1366px then css2 will be apply , . So for my laptop screen css1 should be applied because it has screen width of 1366px .
At ZOOM:100% , this works fine , But if I zoom out , css2 starts applying , I can't understand how this can be happen , my screen width is fixed, So how Zoom out can increase my screen width , .
I become very confused , I am trying to understand this screen resolution, pixels, zoom, for very long time now ,But can't really understand how they works , please help#

Media queries limit the layout width and if this value is reached (for example by reducing the window, or when viewed on a device with the specified size) is already used by a different style. that is how media queries should work.

When you zoom out you're increasing the viewport size. When media queries refer to screen they're talking about the browser's viewport width, not your physical screen's width.

Related

CSS Height width for Samsung A11

I want to test my Website in Samsung A11 screen size can anyone tell me its css height and width.
And also how to calculate css height and width using mobile screen resolution.
The resolution of the screen is 720x1560 pixels. You can use flexbox in order to make your content reponsive to different types of screens.

How to stop viewport width of a label from stretching after a certain browser size

I made a small website where width of certain elements are given in vw. It looked all good in my laptop. But when viewed in a 1920 screen, I could see the content is over stretched. I want to know if there is a way to stop viewport width and viewport paddings I have used in my website to stop stretching the elements after a while.
You can achieve this by setting max-width: value to your container in you css file
Also to set diverent styles after certain screen width you can yuse media query
#media(min-width: 1000px){
//your style
}

I have some svg rectangles. Is it possible to adjust the size as per screen size?

I have some svg rectangles. Is it possible to adjust the size as per screen size? Currently it looks fine on smaller screen but on the bigger screen the rectangles dont take up whole space.
You can use viewport units in CSS.
100vw = 100% screen width
100vh = 100% screen height
Those values can be any percent of the screen.
Mixed with calc(), this can get you almost anything you could want.

what is the difference between : window screen and port screen

i have a WordPress website with this media query
#media screen and (min-width: **312px**) { }
now there are two terms
1: window size for ( 320x533) = window size 320x533 / view port 304x420
2: view port size for ( 320x533) = window size 336x646 / view port 320x533
what is windows size and view size
What you should care about in web design is the viewport. The viewport is the visible area inside the browser window which renders websites. Often the viewport can be slightly obstructed (and therefore is smaller) by a scroll bar.
A viewport of 320px width with a scroll bar may actually only end up being 303px after the scrollbar has been considered.

Scale height of div when width of device is for mobile

I am building a site that uses a very large header image. When the site is viewed on mobile I would like to scale that header div's height to be half of what is is on desktop.
What is the best way to do this with bootstrap 3?
A simple media query will work:
#media all and (max-width: 480px) { // or whatever size you want to target
// change header size
}

Resources