html root tag is provided as font-size 100px, use rem, body not set the font size

Span and can not be found when the parent; inline-block: used today to write a rem style, the premise is to give html set font-size: 100px;; so when calculating the proportion is relatively easy point will result in a span tag to display div elements with high, then asked the great God, the original body forget to set the font-size.

Now, for me,

  html{font-size: 100px;}
  body {font-family: "Microsoft yahei"; font-size: 16px;}
                      These two are essential premise ah (Ma Lei children)!
 
Then I checked on the Internet at other solutions to this problem, generally have the following.
·················································· ???? (the following is a reprint content)
bugs : the HTML unit in use rem {html {font-size: 100px; } } causing high distraction, not vertically aligned with the top, as the added value of the margin-top;

     Since the html font 100px, all of the default font you are 100px, 100px font to accommodate high will of course such a high line. In fact, it is indeed a font 22px, line-height is 22px, the question arises on the div;
hack 1:
(1) you can try to change what another job div row line, once and for all but the most is actually the body's method font-size to 16px, so that you can then use the rem and the default font size is 16px

(2) in vertical alignment, then add line-height attribute ; add to your box line-height = '100px'

Link Address: https://zhidao.baidu.com/question/585309444029037085.html

 

hack 2:

(1) div installation height and relatively positioned, span absolute positioning.

 (2) div height setting, span and other inline element is disposed vertical-align top.

Link Address: https://www.cnblogs.com/hdwang/p/9833113.html

Guess you like

Origin www.cnblogs.com/miniSkytrue/p/12089511.html