<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: encryption akademy</title>
    <description>The latest articles on DEV Community by encryption akademy (@encryption_akademy_85de25).</description>
    <link>https://dev.to/encryption_akademy_85de25</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3282136%2F67ec5020-5540-4562-80cb-bab380a94241.png</url>
      <title>DEV Community: encryption akademy</title>
      <link>https://dev.to/encryption_akademy_85de25</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/encryption_akademy_85de25"/>
    <language>en</language>
    <item>
      <title>CSS Units Tutorial – Absolute units, Relative units, Time units, Angle units &amp; Resolution Units Explained</title>
      <dc:creator>encryption akademy</dc:creator>
      <pubDate>Tue, 24 Jun 2025 06:02:49 +0000</pubDate>
      <link>https://dev.to/encryption_akademy_85de25/css-units-tutorial-absolute-units-relative-units-time-units-angle-units-resolution-units-113g</link>
      <guid>https://dev.to/encryption_akademy_85de25/css-units-tutorial-absolute-units-relative-units-time-units-angle-units-resolution-units-113g</guid>
      <description>&lt;p&gt;This article is part of CSS Complete tutorial and is available at this &lt;a href="https://encryptionakademy.com/css/css-units-tutorial.html" rel="noopener noreferrer"&gt;link&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The basic Goal of CSS is to define characteristics of an elements so the browser engine can paint it on webpage. The most basic building block in CSS is called Decleration. A CSS property and value pair forms an Decleration(name:value). It is used to set an property to specific value.&lt;/p&gt;

&lt;p&gt;In CSS, rules are written as name:value pair. The value of any parameters needs to be expressed in an particular type of unit. There are numerous types of Units available in CSS. Broadly these units can be categorised into two types in CSS.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Absolute Units&lt;/li&gt;
&lt;li&gt;Relative Units&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Absolute Units
&lt;/h2&gt;

&lt;p&gt;Absolute units are standard units which we use in our daily life. The size of these units is fixed and does not change with screen size. These units are more useful when used for printed documents rather than screen. The Absolute Units available is CSS is listed below.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Centimeter - cm&lt;/li&gt;
&lt;li&gt;Millimeter - mm&lt;/li&gt;
&lt;li&gt;Quarter-millimeter - Q&lt;/li&gt;
&lt;li&gt;Inches - in&lt;/li&gt;
&lt;li&gt;Picas - pc&lt;/li&gt;
&lt;li&gt;Points - pt&lt;/li&gt;
&lt;li&gt;Pixels - px&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;1. Centimeter - cm&lt;/strong&gt;&lt;br&gt;
Centimeter is represented as cm. The value of 1 Centimeter is nearly equal to 37.8 pixel or 0.394inch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Millimeter - mm&lt;/strong&gt;&lt;br&gt;
Millimeter is represented as mm. The value of 1 Centimeter is nearly equal to 3.78 pixel or 1/10th of centimeter.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Quarter-millimeter - Q&lt;/strong&gt;&lt;br&gt;
Quarter-millimeter is represented as Q. The value of 1 Quarter-millimeter is nearly equal to 1/40th of centimeter.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Inches - in&lt;/strong&gt;&lt;br&gt;
Inches is represented as in. The value of 1 Inches is nearly equal to 2.54 centimeter or 96 Pixel.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Picas - pc&lt;/strong&gt;&lt;br&gt;
Picas is represented as pc. It is an unit used in typography. It was generally used in newspapers and magzines. The value of 1 Picas is nearly equal to 1/6th of 1 inch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Points - pt&lt;/strong&gt;&lt;br&gt;
Points is represented as pt. It is an unit used in typography. It is generally used by printers or word processing softwares. Traditionally value of 1 point is nearly equal to 1/72th of 1 Inch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Pixel - px&lt;/strong&gt;&lt;br&gt;
Pixel is represented as px. Pixel is the most widely used length unit. Traditionally monitors had an resolution of 1024 X 768 and with an DPI(Dots per Inch) of 96. Hence 1 pixel was considered equal to 1/96th of inch. But monitors now have higher DPI, hence 1 pixel is generally not equal to 1/96th of inch. So the size of 1 pixel vary with device.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;NOTE:&lt;br&gt;
In all the CSS units there is no space between the unit and number. So the correct way of specifying a property value is "20px" and not "20 px".&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Unit&lt;/th&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;th&gt;Equivalent To&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;px&lt;/td&gt;
&lt;td&gt;Pixel&lt;/td&gt;
&lt;td&gt;1px = 1/96in&lt;/td&gt;
&lt;td&gt;Screen-based fixed unit.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;in&lt;/td&gt;
&lt;td&gt;Inch&lt;/td&gt;
&lt;td&gt;1in = 2.54cm&lt;/td&gt;
&lt;td&gt;Physical inch.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;cm&lt;/td&gt;
&lt;td&gt;Centimeter&lt;/td&gt;
&lt;td&gt;1cm = 10mm&lt;/td&gt;
&lt;td&gt;Physical centimeter.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;mm&lt;/td&gt;
&lt;td&gt;Millimeter&lt;/td&gt;
&lt;td&gt;1mm = 10Q&lt;/td&gt;
&lt;td&gt;Physical millimeter.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Q&lt;/td&gt;
&lt;td&gt;Quarter-millimeter&lt;/td&gt;
&lt;td&gt;1Q = 0.25mm = 1/40cm&lt;/td&gt;
&lt;td&gt;Used in Japanese typesetting for fine print control.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;pt&lt;/td&gt;
&lt;td&gt;Point&lt;/td&gt;
&lt;td&gt;1pt = 1/72in&lt;/td&gt;
&lt;td&gt;Standard unit in typography.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;pc&lt;/td&gt;
&lt;td&gt;Pica&lt;/td&gt;
&lt;td&gt;1pc = 12pt = 1/6in&lt;/td&gt;
&lt;td&gt;Used in publishing and layout.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;h2&gt;
  
  
  Relative Units
&lt;/h2&gt;

&lt;p&gt;The value of Relative units depends on something else. Generally they are calculated relative to parent element font or viewport (visible area of screen) size. The main advantage of using Relative units is that their size gets adapted to various screen sizes. The Relative units available is CSS is listed below.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Percentage&lt;/li&gt;
&lt;li&gt;rem&lt;/li&gt;
&lt;li&gt;ex&lt;/li&gt;
&lt;li&gt;ch&lt;/li&gt;
&lt;li&gt;lh&lt;/li&gt;
&lt;li&gt;rlh&lt;/li&gt;
&lt;li&gt;em&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;1. The Percentage % Unit&lt;/strong&gt;&lt;br&gt;
The Percentage % unit is is a relative unit in CSS that expresses a value as a fraction of another value — usually the value of a parent element or containing block, depending on the CSS property. This unit can be used with various properties such as width, height, margin, padding, and font-size.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div&amp;gt;
  &amp;lt;div&amp;gt;Width: 50%&amp;lt;/div&amp;gt;
  &amp;lt;div&amp;gt;Width: 30%&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsb4jqi6bjckpzbxfq0iu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsb4jqi6bjckpzbxfq0iu.png" alt="Image description" width="800" height="138"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let us see the Behavior of various propeties when percentage is used by Property Type.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CSS Percentage-Based Properties&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Property&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Percentage is Relative To&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;width&lt;/code&gt;, &lt;code&gt;min-width&lt;/code&gt;, &lt;code&gt;max-width&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Width of the parent element&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;height&lt;/code&gt;, &lt;code&gt;min-height&lt;/code&gt;, &lt;code&gt;max-height&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Height of the parent element (only works if parent has defined height)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;margin&lt;/code&gt;, &lt;code&gt;padding&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Width of the parent (even for top/bottom)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;font-size&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Font size of the parent element&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;translate&lt;/code&gt;, &lt;code&gt;top&lt;/code&gt;, &lt;code&gt;left&lt;/code&gt; (positioning)&lt;/td&gt;
&lt;td&gt;Size of the containing block&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;2. The em Unit&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In CSS em unit refers to font-size of the current HTML element it is used for. If the font-size of an element is 12px then 1em is equal to 12px for that element. Hence the value changes from element to element.&lt;/p&gt;

&lt;p&gt;When em is used for font-size property it is relative to font size of parent element. Because of this em unit often gets compounded with subsequent childrens.&lt;/p&gt;

&lt;p&gt;Example: Consider You have 3 divs, where Ist div is parent of 2nd div and 2nd div parent of 3rd. If font-size of 1st, 2nd and 3rd div is set to 20px, 1.5em, 1.5em respectively. So the font-size of 2nd div becomes 20 x 1.5 = 30px and font-size of 3rd div becomes 30 x 1.5 = 45px. So you have to be carefull while using em unit.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzd6ynborx0hg94hd3noc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzd6ynborx0hg94hd3noc.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. The rem Unit&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The rem unit is relative to the font size of the webpage's root element (). So 1rem is equal to the font-size value of root element.&lt;/p&gt;

&lt;p&gt;This unit brings consistency in design. It overcomes the compounding effect caused by nested elements because its value is not effected by parent elements. In case the font-size of root element is not set, it is equal to default font-size provided by Browser and is generally 16px.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div style="font-size: 30px;"&amp;gt; 
 &amp;lt;p style="font-size: 1em;"&amp;gt; 
  I am text with font-size 1em. 
 &amp;lt;/p&amp;gt; 
 &amp;lt;p style="font-size: 1rem;"&amp;gt; 
  I am text with font-size 1rem. 
 &amp;lt;/p&amp;gt; 

&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flr2vpfwapwwl3pvbmjpa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flr2vpfwapwwl3pvbmjpa.png" alt="Image description" width="800" height="240"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. The ex Unit&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The CSS ex unit is based on the height of lowercase letter "x" in the font used. The size of letter x is different in each font. So if two paragraphs use different fonts, then the value of ex can be different for each paragraph. Hence it is rarely used.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5ic5hxk8zbaiv4645ilm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5ic5hxk8zbaiv4645ilm.png" alt="Image description" width="361" height="97"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. The ch Unit&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The ch unit also known as character Unit, is based on width of character 0(zero) of the font used. So 1ch is equal to width of character 0.&lt;/p&gt;

&lt;p&gt;For a monospace font like "Courier" all the characters are exaclty 1ch in width. But for majority other fonts which are proportional in nature, a character may be smaller or bigger than 0.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvtdwhhdxvciw5lj9di94.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvtdwhhdxvciw5lj9di94.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Line Height Units
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;6. The lh Unit&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The lh unit is based on line-height of current element that it is being applied to. Browser assigns every line an box with text vertically centered in it. So 1lh equals this line height as shown in figure below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcgaxl24ao3neot6086d9.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcgaxl24ao3neot6086d9.PNG" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The rlh Unit
The rlh unit is based on line-height of root element () of the webpage.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Resolution Based Units
&lt;/h2&gt;

&lt;p&gt;A resolution is used to specify the pixel density of the output device. In CSS there are units based on resolution which are listed below.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dots per inch - dpi&lt;/li&gt;
&lt;li&gt;Dots per centimeter - dpcm&lt;/li&gt;
&lt;li&gt;Dots per pixel unit - dppx&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl9u3sfq253d684m53q24.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl9u3sfq253d684m53q24.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Dots per inch - dpi&lt;/strong&gt;&lt;br&gt;
dpi stands for dots per inch. This dot represents dots on paper for printed documents, pixel for desktop or mobile devices.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Dots per centimeter - dpcm&lt;/strong&gt;&lt;br&gt;
dpcm stands for dots per centimeter. It is same as dpi except centimeter is used in place of inch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Dots per pixel unit - dppx&lt;/strong&gt;&lt;br&gt;
dppx stands for dots per pixel unit. In simple words it is a CSS unit that tells how many real screen pixels fit into one CSS pixel. Think of it like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;1 dppx = 1 screen pixel for every CSS pixel → normal screen&lt;/li&gt;
&lt;li&gt;2 dppx = 2 screen pixels for every CSS pixel → retina or high-resolution screen&lt;/li&gt;
&lt;li&gt;3 dppx = 3 screen pixels for every CSS pixel → ultra high-resolution screen&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;NOTE:&lt;br&gt;
x is alias for dppx&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
  
  
  Time Units
&lt;/h2&gt;

&lt;p&gt;In CSS Time Units are used to define durations for transitions, animations, delays, etc. CSS provides two main time units:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;seconds - s&lt;/li&gt;
&lt;li&gt;milliseconds - ms&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;1. seconds - s&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;s stands for seconds, the base unit of time in CSS for animations and transitions. Typically used for longer durations, like animations or loading sequences.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;div {
  animation: fadeIn 2s ease-in;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. milliseconds - ms&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ms stands for milliseconds (1/1000 of a second). Best for faster or subtle effects where even a small delay matters. The common use cases are listed below.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Quick hover or focus effects&lt;/li&gt;
&lt;li&gt;Button presses&lt;/li&gt;
&lt;li&gt;Tooltip appearances&lt;/li&gt;
&lt;li&gt;Micro-interactions (e.g., toggles, checkboxes)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;button {
  transition: background-color 150ms ease;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Angle Units
&lt;/h2&gt;

&lt;p&gt;CSS angle units are used to represent rotations, directions, and gradients. They are most commonly use them in: transform: rotate(), conic-gradient(), linear-gradient() (angle direction), @keyframes (e.g., rotating elements). The Angle Units available in CSS are listed below.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;degrees - deg&lt;/li&gt;
&lt;li&gt;gradians - grad&lt;/li&gt;
&lt;li&gt;radians - rad&lt;/li&gt;
&lt;li&gt;turns - turn&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;1. degrees - deg&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It is the most common and human-readable unit. 1 full rotation is euqal to 360°.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;transform: rotate(90deg);     /* quarter turn */
transform: rotate(-45deg);    /* counter-clockwise */
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. gradians - grad&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Gradians were designed to make angular measurements more decimal-friendly, with 100 gradians in a right angle instead of 90 degrees. This makes calculations easier in some surveying and engineering applications.&lt;br&gt;
Key conversions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;400 gradians = 360 degrees (full circle)&lt;/li&gt;
&lt;li&gt;200 gradians = 180 degrees (straight angle)&lt;/li&gt;
&lt;li&gt;100 gradians = 90 degrees (right angle)&lt;/li&gt;
&lt;li&gt;1 gradian = 0.9 degrees&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This unit is used in engineering, surveying, scientific applications. It is rarely used in web design but supported.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqmx48gn6oqtnvmkuh2vs.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqmx48gn6oqtnvmkuh2vs.jpg" alt="Image description" width="250" height="242"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;transform: rotate(100grad);   /* 90 degrees */
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. radians - rad&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Radian is a unit of angular measurement, based on the radius of a circle rather than arbitrary divisions.&lt;/p&gt;

&lt;p&gt;One radian is the angle you get when you take the radius of a circle and wrap it around the circumference. Since the circumference of a circle is 2π times the radius, a full circle contains exactly 2π radians.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk33bihq9bkrd737nsjt7.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk33bihq9bkrd737nsjt7.gif" alt="Image description" width="450" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To convert between them:&lt;br&gt;
Degrees to radians: multiply by π/180&lt;br&gt;
Radians to degrees: multiply by 180/π&lt;/p&gt;

&lt;p&gt;Key conversions:&lt;/p&gt;

&lt;p&gt;360° = 2π radians&lt;br&gt;
180° = π radians&lt;br&gt;
90° = π/2 radians&lt;br&gt;
60° = π/3 radians&lt;br&gt;
45° = π/4 radians&lt;br&gt;
30° = π/6 radians&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;transform: rotate(1.57rad);  /* ~90 degrees */
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;4. turns - turn&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The turns unit represents an angle in a number of turns. One full circle is equal to 1turn. This unit makes easy to express half or quarter turns.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;transform: rotate(1turn);     /* full rotation */
transform: rotate(0.25turn);  /* 90 degrees */
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>CSS Viewport-units - A detailed Guide</title>
      <dc:creator>encryption akademy</dc:creator>
      <pubDate>Mon, 23 Jun 2025 05:39:46 +0000</pubDate>
      <link>https://dev.to/encryption_akademy_85de25/css-viewport-units-a-detailed-guide-4pd</link>
      <guid>https://dev.to/encryption_akademy_85de25/css-viewport-units-a-detailed-guide-4pd</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd6skosy7jifiykrj4hav.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd6skosy7jifiykrj4hav.PNG" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This article is part of CSS complete tutorial by encryption-akademy and available at this &lt;a href="https://encryptionakademy.com/css/css-viewport-units-tutorial.html" rel="noopener noreferrer"&gt;link&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Viewport is the area of window in which webpage is currently seen. In terms of web-browser, it is same as browser window and excludes menu bar etc. Its size varies with device, mode and orientation. In CSS there are 6 units based on viewport which are listed below.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;viewport width unit - vw&lt;/li&gt;
&lt;li&gt;viewport height unit - vh&lt;/li&gt;
&lt;li&gt;viewport block unit - vb&lt;/li&gt;
&lt;li&gt;viewport inline unit - vi&lt;/li&gt;
&lt;li&gt;viewport minimum unit - vmin&lt;/li&gt;
&lt;li&gt;viewport maximum unit - vmax&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;1. viewport width unit - vw&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;VW stands for Viewport width. It is an unit to measure the width of viewport. VW is equivalent to percentage of viewport width. So 10vw is equal to 10% of viewport width and 100vw is full width of viewport.&lt;/p&gt;

&lt;p&gt;Example: consider viewport dimensions as 1920px x 1080px. So 10vw is calculated as 10% of 1920 which is equal to 192px.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs8biniwhwk1ulxnwj6c0.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs8biniwhwk1ulxnwj6c0.PNG" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. viewport height unit - vh&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;VW stands for Viewport height. It is an unit to measure the height of viewport. VW is equivalent to percentage of viewport height. So 10vh is equal to 10% of viewport height and 100vh is full height of viewport.&lt;/p&gt;

&lt;p&gt;For example consider viewport dimensions as 1920px x 1080px. So 10vh is calculated as 10% of 1080 which is equal to 108px.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. viewport minimum unit - vmin&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;vmin stands for viewport minimum. This unit refers to dimension of viewport which is smaller(either height or width). 10vmin is equal to 10% of smaller dimension of viewport and 100vmin is full size of it.&lt;/p&gt;

&lt;p&gt;Example: consider viewport dimensions as 1920px x 1080px. &lt;br&gt;
So in portrait mode vmin unit will refer to 1080px and 10vmin is calculated as 10% of 1080 which is equal to 108px, &lt;br&gt;
While in landscape mode, vmin will again refer to 1080px.&lt;br&gt;
In contrast, the vh/vw unit will correspond to different dimension in portrait and landscape mode.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy9ljhlfnbpx07xxt59ek.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy9ljhlfnbpx07xxt59ek.PNG" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. viewport maximum unit - vmax&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;vmax stands for viewport maximum. This unit refers to dimension of viewport which is larger(either height or width). 10vmax is equal to 10% of Larger dimension of viewport and 100vmin is full size of it.&lt;/p&gt;

&lt;p&gt;For example consider viewport dimensions as 1920px x 1080px. So in portrait mode vmax unit will refer to 1080px and 10vmax is calculated as 10% of 1920 which is equal to 192px, &lt;br&gt;
While in landscape mode, vmax will again refer to 1920px.&lt;br&gt;
In contrast, the vh/vw unit will correspond to different dimension in portrait and landscape mode.&lt;/p&gt;

&lt;h2&gt;
  
  
  Block And Inline Axis
&lt;/h2&gt;

&lt;p&gt;Not all language in world starts at left side of line. Each language has has its own direction of text flow. For example Arabic languages are right-to-left in direction. Chinese or japanese Languages are written from top-to-bottom with new line added to left. To incorprate all these writing modes, CSS introduced two new properties vi and vb which depend on Inline and Block Axis.&lt;/p&gt;

&lt;p&gt;Inline Axis is parallel to the flow of text. It is horizontal axis for horizontal witing modes and vertical for vertical witing modes. For example it is horizontal axis for English Language.&lt;/p&gt;

&lt;p&gt;Block Axis is perpendicular to the flow of text. It is vertical axis for horizontal witing modes and horizontal for vertical witing modes. For example it is vertical axis for English Language.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft5ppsar8ezq8s99er2lc.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft5ppsar8ezq8s99er2lc.PNG" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. viewport inline unit - vi&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;vi stands for Viewport Inline. It has the same direction as Inline Axis. For horizontal writing mode it corresponds to width and for vertical writing mode it corresponds to height of viewport. 1vi is 1% of viewport size along inline axis.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. viewport block unit - vb&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;vb stands for Viewport Block. It has the same direction as Block Axis. For horizontal writing mode it corresponds to height and for vertical writing mode it corresponds to width of viewport. 1vb is 1% of viewport size along block axis.&lt;/p&gt;

&lt;h2&gt;
  
  
  Viewport Unit Modifiers
&lt;/h2&gt;

&lt;p&gt;All the above Viewport units works perfectly for desktop computers, but presents challenges on mobile devices. The viewport of mobiles changes due to the presence of scrollable toolbars. These toolbar generally consists of address bar, navigation bar and other. They contracts and expands on scrolling based on user input.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmy2flpjjxubhduxt394a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmy2flpjjxubhduxt394a.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To overcome this problem, the various states of the viewport has been defined/specified and new units have been created based on these new viewport states. These new states and corresponding new units are listed below.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Large Viewport - lvw, lvh, lvmin, lvmax, lvi, lvb&lt;/li&gt;
&lt;li&gt;Small Viewport - svw, svh, svmin, svmax, svi, svb&lt;/li&gt;
&lt;li&gt;Dynamic Viewport - dvw, dvh, dvmin, dvmax, dvi, dvb&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6m54fcedtir5i6siv5bw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6m54fcedtir5i6siv5bw.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Large Viewport
&lt;/h2&gt;

&lt;p&gt;Large Viewport is a state when all toolbars are contracted to their fullest extent. So the maximum screen area becomes available for page content.&lt;/p&gt;

&lt;p&gt;The Large Viewport units allows developer to size an element by full viewport area. These units have the lv prefix followed by the six viewport units which we had seen earlier. The units are lvw, lvh, lvmin, lvmax, lvi, lvb. These units are described briefly in the below table.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F470ragx12gu9xaj9ji1f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F470ragx12gu9xaj9ji1f.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Unit&lt;/th&gt;
&lt;th&gt;Full Name&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;What it Represents&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;lvw&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Large Viewport Width&lt;/td&gt;
&lt;td&gt;1% of the large viewport's width&lt;/td&gt;
&lt;td&gt;Width when browser UI is hidden (maximum width available)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;lvh&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Large Viewport Height&lt;/td&gt;
&lt;td&gt;1% of the large viewport's height&lt;/td&gt;
&lt;td&gt;Height when browser UI is hidden (maximum height available)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;lvi&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Large Viewport Inline&lt;/td&gt;
&lt;td&gt;1% of the large viewport's inline dimension&lt;/td&gt;
&lt;td&gt;Inline direction size (typically width in horizontal text layouts)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;lvb&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Large Viewport Block&lt;/td&gt;
&lt;td&gt;1% of the large viewport's block dimension&lt;/td&gt;
&lt;td&gt;Block direction size (typically height in horizontal text layouts)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;lvmin&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Large Viewport Minimum&lt;/td&gt;
&lt;td&gt;1% of the smaller dimension&lt;/td&gt;
&lt;td&gt;Whichever is smaller between &lt;code&gt;lvh&lt;/code&gt; and &lt;code&gt;lvw&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;lvmax&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Large Viewport Maximum&lt;/td&gt;
&lt;td&gt;1% of the larger dimension&lt;/td&gt;
&lt;td&gt;Whichever is larger between &lt;code&gt;lvh&lt;/code&gt; and &lt;code&gt;lvw&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Small Viewport
&lt;/h2&gt;

&lt;p&gt;Small Viewport is a state when all toolbars are expanded to their fullest extent. So the minimum screen area becomes available for page content.&lt;/p&gt;

&lt;p&gt;The Small Viewport units allows developer to size an element in accordance to smallest viewport area. These units have sv prefix. The units are svw, svh, svmin, svmax, svi, svb. These units are described briefly in the below table.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fshgvtrlhkp2j74xwfzlr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fshgvtrlhkp2j74xwfzlr.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Unit&lt;/th&gt;
&lt;th&gt;Full Name&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;What it Represents&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;svw&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Small Viewport Width&lt;/td&gt;
&lt;td&gt;1% of the small viewport's width&lt;/td&gt;
&lt;td&gt;Width when browser UI is shown (minimum width available)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;svh&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Small Viewport Height&lt;/td&gt;
&lt;td&gt;1% of the small viewport's height&lt;/td&gt;
&lt;td&gt;Height when browser UI is shown (minimum height available)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;svi&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Small Viewport Inline&lt;/td&gt;
&lt;td&gt;1% of the small viewport's inline dimension&lt;/td&gt;
&lt;td&gt;Inline direction size (typically width in horizontal text layouts)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;svb&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Small Viewport Block&lt;/td&gt;
&lt;td&gt;1% of the small viewport's block dimension&lt;/td&gt;
&lt;td&gt;Block direction size (typically height in horizontal text layouts)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;svmin&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Small Viewport Minimum&lt;/td&gt;
&lt;td&gt;1% of the smaller dimension&lt;/td&gt;
&lt;td&gt;Whichever is smaller between &lt;code&gt;svh&lt;/code&gt; and &lt;code&gt;svw&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;svmax&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Small Viewport Maximum&lt;/td&gt;
&lt;td&gt;1% of the larger dimension&lt;/td&gt;
&lt;td&gt;Whichever is larger between &lt;code&gt;svh&lt;/code&gt; and &lt;code&gt;svw&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Dynamic Viewport
&lt;/h2&gt;

&lt;p&gt;Dynamic Viewport is a state which is compatible with changes in the viewport. It adjusts itself according to UI changes by equating itself to current viewport.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;When all toolbars are expanded and viewport becomes smallest possible, then Dynamic Viewport becomes equal to size of Small viewport&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When all toolbars are contracted and viewport becomes largest possible, then Dynamic Viewport becomes equal to size of large viewport&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzqkbllftzimpluys0x0p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzqkbllftzimpluys0x0p.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Dynamic Viewport units allows developer to set lenghts according to the size of viewport in every state. These units have dv prefix. The units are dvw, dvh, dvmin, dvmax, dvi, dvb.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Unit&lt;/th&gt;
&lt;th&gt;Full Name&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;What it Represents&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;dvw&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Dynamic Viewport Width&lt;/td&gt;
&lt;td&gt;1% of the dynamic viewport's width&lt;/td&gt;
&lt;td&gt;Width that adapts as browser UI dynamically shows/hides&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;dvh&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Dynamic Viewport Height&lt;/td&gt;
&lt;td&gt;1% of the dynamic viewport's height&lt;/td&gt;
&lt;td&gt;Height that adapts as browser UI dynamically shows/hides&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;dvi&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Dynamic Viewport Inline&lt;/td&gt;
&lt;td&gt;1% of the dynamic viewport's inline dimension&lt;/td&gt;
&lt;td&gt;Inline direction size that adapts dynamically (typically width in horizontal text layouts)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;dvb&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Dynamic Viewport Block&lt;/td&gt;
&lt;td&gt;1% of the dynamic viewport's block dimension&lt;/td&gt;
&lt;td&gt;Block direction size that adapts dynamically (typically height in horizontal text layouts)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;dvmin&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Dynamic Viewport Minimum&lt;/td&gt;
&lt;td&gt;1% of the smaller dimension&lt;/td&gt;
&lt;td&gt;Whichever is smaller between &lt;code&gt;dvh&lt;/code&gt; and &lt;code&gt;dvw&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;dvmax&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Dynamic Viewport Maximum&lt;/td&gt;
&lt;td&gt;1% of the larger dimension&lt;/td&gt;
&lt;td&gt;Whichever is larger between &lt;code&gt;dvh&lt;/code&gt; and &lt;code&gt;dvw&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

</description>
    </item>
  </channel>
</rss>
