Search
 
SCRIPT & CODE EXAMPLE
 

CSS

media query not working with rem

/*
Media query declarations do not base themselves on the declared font-size that you apply to html
and instead always use the default size - 
which is 16px in most browsers

Relative units in media queries are based on the initial value, 
which means that units are never based on results of declarations. 
For example, in HTML, the em unit is relative to the initial value of font-size, 
defined by the user agent or the user’s preferences, not any styling on the page.
*/

html {
  font-size: 10px;
}

@media screen and (min-width: 50rem){ /* 800px (uses base font-size) */
  div.somediv {
    width: 50rem; /* 500px (uses the declared html font-size) */
  }
}
Comment

PREVIOUS NEXT
Code Example
Css :: why wont text color of a div change 
Css :: cd cover dimensions 
Css :: css all children of type 
Css :: Evaluate ruby code inside html :css filter 
Css :: set div tomiddle css 
Css :: button position translate on bottom edge bootstrap 
Css :: Css keep element on same position among different screen size 
Css :: PY Bisect key sort 
Css :: how to limit css to min max large screen size 
Css :: background shorthand code 
Css :: pacSelectFirst( submit button 
Css :: capitalize only first letter css 
Css :: sasas 
Css :: css background image is not show change default picture 
Css :: css to exclude last row table 
Css :: how to show image son hover cells in excel 
Css :: Selection Handler css 
Css :: symfony modify request 
Css :: react-responsive modal flashes after closing 
Css :: change d in path svg css 
Css :: how to make button clickable in particle.js section 
Css :: how to stop a blue color on touch in css 
Css :: vue center components in body 
Css :: how to active horizental scroll for navbar menu in mobile screen 
Css :: enlarge ionicons css 
Css :: center content in div 
Css :: child theme broken header "styles.css" 
Css :: count elements with css if only you have just 2 - no more or less 
Css :: elemento SPAN 
Css :: overwrite theme css in parent css 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =