CSS Value Resolution (original) (raw)

Last Updated : 29 Jun, 2021

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:

Units: There are 3 main units for specifying Resolution-

Example of Resolution:

html

<!DOCTYPE html>

< html >

< head >

`` < style >

`` h1 {

`` border: 2px solid #000000;

`` }

`` /* Exact resolution */

`` @media (min-resolution: 10dpi) {

`` h1 {

`` color: white;

`` }

`` }

`` /* Exact resolution */

`` @media (max-resolution: 500dpi) {

`` h1 {

`` background: green;

`` }

`` }

`` </ style >

</ head >

< body >

`` < h1 >Geeks For Geeks Example</ h1 >

</ body >

</ html >

Output:

OUTPUT

As shown in the above example :