Search
 
SCRIPT & CODE EXAMPLE
 

CSS

css media query aspect ratio

/* Minimum aspect ratio */
@media (min-aspect-ratio: 8/5) {
  div {
    background: #9af; /* blue */
  }
}

/* Maximum aspect ratio */
@media (max-aspect-ratio: 3/2) {
  div {
    background: #9ff;  /* cyan */
  }
}

/* Exact aspect ratio, put it at the bottom to avoid override*/
@media (aspect-ratio: 1/1) {
  div {
    background: #f9a; /* red */
  }
}
Comment

aspect ratio css media query

/* Minimum aspect ratio */
@media (min-aspect-ratio: 8/5) {
  div {
    background: #9af; /* blue */
  }
}

/* Maximum aspect ratio */
@media (max-aspect-ratio: 3/2) {
  div {
    background: #9ff;  /* cyan */
  }
}

/* Exact aspect ratio, put it at the bottom to avoid override*/
@media (aspect-ratio: 1/1) {
  div {
    background: #f9a; /* red */
  }
}
Comment

PREVIOUS NEXT
Code Example
Css :: para que sirve justify-content-center 
Css :: scrollbar 
Css :: color gradient 
Css :: how to make a text in center with background color in css 
Css :: up arrow css 
Css :: css border with 8 values 
Css :: adding quotes css 
Css :: tailwind css next 
Css :: css grid first child 
Css :: text-align attribute in css 
Css :: textarea { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; width: 100%; } 
Css :: border style shorthand 
Css :: negative border radius 
Css :: inline block and 50% width not aligning items 
Css :: css3 ripple loop 
Css :: patterns with css 
Css :: contrast color using css 
Css :: scss to css 
Css :: python css 
Css :: why is there whitespace on the top 
Css :: html css landing page 
Css :: css gap 
Css :: materialize css icons 
Css :: fortnite pc size 2022 
Css :: rotating text animation 
Css :: @font-face or font link 
Css :: blurring behind a div 
Css :: horizontal scroll bar 
Css :: bootstrap-navbar-brand 
Css :: Creating a project in pycharm using scrapy 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =