<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <style type="text/css"> #div2{ font-size: 100px; } span{ font-size: rem; } </style> </head> <body> <div id="div1"> <h1>helloworld</h1> </div> <div id="div2"> <!--div2,字体大小是100像素--> <!--h1字体大小是2em,那么就是div2的字体大小的2倍,那么就是200px--> <!--span字体大小是1.5em,那么就是h1字体大小的1.5倍,那么就是200*1.5=300px--> <h1>helloworld2 <span>span</span></h1> </div> </body> </html>