Answers for "aspect-ratio css"

CSS
-1

keep aspect ratio of image css

img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
}
Posted by: Guest on April-29-2020
2

aspect-ratio css

aspect-ratio: 1 / 1;
Posted by: Guest on February-10-2021
2

aspect ratio css

aspect-ratio: 16 / 9;
// horizontal/vertical
Posted by: Guest on July-15-2021
0

device-pixel-ratio css

/* Exact resolution */
@media (-webkit-device-pixel-ratio: 1) {
  p {
    color: red;
  }
}

/* Minimum resolution */
@media (-webkit-min-device-pixel-ratio: 1.1) {
  p {
    font-size: 1.5em;
  }
}

/* Maximum resolution */
@media (-webkit-max-device-pixel-ratio: 3) {
  p {
    background: yellow;
  }
}
Posted by: Guest on December-08-2020

Code answers related to "aspect-ratio css"

Browse Popular Code Answers by Language