IE browser loading rem adaptive web page element size display exception

common problem zero six hundred and one

Use rem to create an adaptive web page with equal scale. After the page is loaded in IE browser, use rem The size of the unit page element displays abnormally. The reason is to label the body font-size The attribute defines a fixed size default value. The solution is to set the font-size Property value is set to 100% , delete the attribute directly.

 IE browser loading rem adaptive web page element size display exception

Example:

Original code

 body {	font:normal 16px/1.875em 'Arial';}

Modify to

 body {	font:normal 100%/1.875em 'Arial';}

If you want to define the default font size for the web page without affecting rem, add a div between the bodies, and then define the default value for this div

Example:

HTML code

 <html> <head> …… </head> <body> <div id="wrapper"> …… </div> </body> </html>

CSS code

 body { font-size:100%; } #wrapper { font-size:16px; line-height:1.875em; }

Message from netizens:

I would like to comment:

◎ Welcome to participate in the discussion. Please express your views and exchange your views here.
 Verification Code