html - Is it necessary to set the base font-size when sizing with rem? -


i have seen multiple approaches web typography suggested setting base font-size (on either html or body element) precise pixel value, or percentage (62,5% example, easy sizing em, or 100%).

i'm researching whether still necessary, when sizing type rem. idea when working > ie9, rem easy way size type based on users preferred base font-size. is:

  • good accessibility (i.e. not overriding users preferences)
  • easy design (the values don't cascade, , entire design can sized or down, it's fluid)

but since there many recommendations, i'm wondering: there i'm missing? current state of affairs regarding font-sizing? there accessibility concerns approach, things haven't thought of? looking source material deals issue, standpoint of current state of affairs, not opinions.

rem based on root element, or html tag size, giving size advised. wouldn't wonder 'user preference', since modern browser enlarge uniformly. golden rule set html size base value in pixels:

html { font-size: 12px; } 

simply because it's easy calculate there. after that, set every subsequent font value this:

.element {     font-size: 12px;     font-size: 1em;     font-size: 1rem; } 

it seems quite extensive, allows maximum compatibility. accessibility wise it's not concern, increasing size of font in browser increase original 12px in html, , enlarge rest subsequently.


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -