If the mobile terminal uses dense media queries to set the rem size, does the element size use rem, or only the font use rem?

  html5, question

1. How to determine the boundary of media query and the font size of html.
2. Whether the font is rem or the element width and height can also be rem.
3, a small white one, thank you for your advice.

(function(doc, win) {
 var docEl = doc.documentElement,
 resizeEvt = 'orientationchange' in window ?  'orientationchange' : 'resize',
 recalc = function() {
 var clientWidth = docEl.clientWidth;
 if (!  clientWidth) return;
 docEl.style.fontSize = 100 * (clientWidth / 640) + 'px';
 if (!  doc.addEventListener) return;
 win.addEventListener(resizeEvt, recalc, false);
 doc.addEventListener('DOMContentLoaded', recalc, false);
 })(document, window);

Both elements and fonts can be used rem, where 640 is the size of the design draft, which is modified according to the size of your PSD. Multiplied by 100 is for convenience of calculation, for example, a picture in the design draft is 300 * 400, then with:3rem of div; height:4rem;

Regarding how to use rem for adaptation, please refer to the sites that have already used rem for adaptation:Gather one’s profits Netease news