CSS Resolution is one of the data-type. As the name suggests it is used for specification of resolution meaning the density of pixels on the output device. Resolutions are generally used while writing media-queries. The user can use the resolution with max and min prefix while writing the media Query.
What is Media Query :Media Query is used for Responsive web development which can be used to change the screen styling based on the various characteristics of the output device. It is defined in CSS3.
Characteristics of Resolution data-type:
- It is always a positive value.
- It always has a unit: dpi, dpcm, dppx, x.
- There should not be any space between the positive value and unit.
Units: There are 3 main units for specifying Resolution-
- dpi: It stands for Number of dots per inch.
- dpcm: It stands for dots per centimeter.
- dppx or x: dots per px unit.
Example of Resolution:
As shown in the above example :
- min-resolution is set to 10dpi, hence on device with resolution greater than 10dpi color : white styling will be applied to <h1> tag
- max-resolution is set to 500dpi, hence on device with resolution less than 500dpi backgound : green styling will be applied to <h1> tag
- Domain Resolution and URL Processing
- How to override the CSS properties of a class using another CSS class ?
- Difference between bootstrap.css and bootstrap-theme.css
- CSS | Percentage Value
- CSS Value | Angle
- CSS | [attribute$=value] Selector
- CSS | [attribute=value] Selector
- CSS | [attribute*=value] Selector
- CSS | [attribute|=value] Selector
- CSS | [attribute~=value] Selector
- CSS | [attribute^=value] Selector
- CSS | Value Integer
- CSS Value Inherit
- CSS Value | Unset
- CSS Value | Initial
- CSS Value Time
- CSS Value String
- CSS Ratio Value
- CSS Frequency Value
- How to get hex color value of RGB value ?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.