@viewport
Quick Summary for min-zoom (@viewport)
Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
Code Usage for min-zoom (@viewport)
@viewport {   width: 100vw; /*Sets the width of the actual viewport to the device width*/ } 
More Details for min-zoom (@viewport)

@viewport

Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

Note: See https://github.com/w3c/csswg-drafts/issues/4766 for discussion around @viewport's removal from the standards track.

The @viewport CSS at-rule lets you configure the viewport through which the document is viewed. It's primarily used for mobile devices, but is also used by desktop browsers that support features like "snap to edge" (such as Microsoft Edge).

Lengths specified as percentages are calculated relative to the initial viewport, which is the viewport before any user agent or authored styles have had an opportunity to adjust the viewport. This is typically based on the size of the window on desktop browsers that aren't in fullscreen mode.

On mobile devices (or desktop devices that are in fullscreen mode), the initial viewport is usually the portion of a device's screen that is available for application use. This may be either the full screen or the full screen area minus areas controlled by the operating system (such as a taskbar) or the application-available screen area (either the full screen or the screen minus any areas owned by the operating system or other applications).

@viewport {   width: 100vw; /*Sets the width of the actual viewport to the device width*/ } 

Note: The use of <meta name="viewport"> tag overrides @viewport

Syntax

The at-rule contains a set of nested descriptors in a CSS block that is delimited by curly braces.

A zoom factor of 1.0 or 100% corresponds to no zooming. Larger values zoom in. Smaller values zoom out.

Descriptors

Browser support for @viewport is weak at this time, with support being largely available in Internet Explorer and Edge. Even in those browsers, only a small number of descriptors are available. Browsers will ignore @viewport if they don't support it, and will ignore any descriptors that they don't recognize.

min-width

Used in the determination of the width of the viewport when the document is first displayed.

max-width

Used in the determination of the width of the viewport when the document is first displayed.

width

A shorthand descriptor for setting both min-width and max-width.

min-height

Used in the determination of the height of the viewport when the document is first displayed.

max-height

Used in the determination of the height of the viewport when the document is first displayed.

height

A shorthand descriptor for setting both min-height and max-height.

zoom

Sets the initial zoom factor.

min-zoom

Sets the minimum zoom factor.

max-zoom

Sets the maximum zoom factor.

user-zoom

Controls whether or not the user should be able to change the zoom factor.

orientation

Controls the document's orientation.

viewport-fit

Controls the display of the document on non-rectangular displays.

Formal syntax

@viewport {   <group-rule-body> }

Examples

Setting viewport size, zoom, and orientation

@viewport {   min-width: 640px;   max-width: 800px; }  @viewport {   zoom: 0.75;   min-zoom: 0.5;   max-zoom: 0.9; }  @viewport {   orientation: landscape; } 

Specifications

Specification
CSS Device Adaptation Module Level 1 # atviewport-rule

See also

<meta>, specifically <meta name="viewport"> Using the viewport meta tag to control layout on mobile browsers Select your preferred language English (US)DeutschFrançais日本語한국어Русский中文 (简体)正體中文 (繁體) Change language

No Items Found.

Add Comment
Type in a Nick Name here
 
Other Categories in CSS
css
Search CSS
Search CSS by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code here, mostly for my reference. Also if i find a good link, i usually add it here and then forget about it. more...

Subscribe to weekly updates about things i have added to the site or thought interesting during the last week.

You could also follow me on twitter or not... does anyone even use twitter anymore?

If you found something useful or like my work, you can buy me a coffee here. Mmm Coffee. ☕

❤️👩‍💻🎮

🪦 2000 - 16 Oct 2022 - Boots
Random Quote

"Olivia, my eldest daughter, caught measles when she was seven years old. As the illness took its usual course I can remember reading to her often in bed and not feeling particularly alarmed about it. Then one morning, when she was well on the road to recovery, I was sitting on her bed showing her how to fashion little animals out of coloured pipe-cleaners, and when it came to her turn to make one herself, I noticed that her fingers and her mind were not working together and she couldn’t do anything. 'Are you feeling all right?' I asked her. 'I feel all sleepy,' she said. In an hour, she was unconscious. In twelve hours she was dead. The measles had turned into a terrible thing called measles encephalitis and there was nothing the doctors could do to save her. That was...in 1962, but even now, if a child with measles happens to develop the same deadly reaction from measles as Olivia did, there would still be nothing the doctors could do to help her. On the other hand, there is today something that parents can do to make sure that this sort of tragedy does not happen to a child of theirs. They can insist that their child is immunised against measles. ...I dedicated two of my books to Olivia, the first was ‘James and the Giant Peach’. That was when she was still alive. The second was ‘The BFG’, dedicated to her memory after she had died from measles. You will see her name at the beginning of each of these books. And I know how happy she would be if only she could know that her death had helped to save a good deal of illness and death among other children."

I just checked google books for BFG, and the dedication is there. 

https://www.google.com.au/books/edition/_/quybcXrFhCIC?hl=en&gbpv=1 


Roald Dahl, 1986
Random CSS Property

overscroll-behavior-y

The overscroll-behavior-y CSS property sets the browser's behavior when the vertical boundary of a scrolling area is reached.
overscroll-behavior-y css reference