• PX is a specific unit of size, similar to the meter and centimeter used in ordinary times

  • Em is a multiple of font-size relative to its parent element

  • Rem is a multiple of font size relative to the root element in HTML

    <style>
            html {font-size: 100px; }div {font-size: 20px; }p {font-size: 2em; /* Font-size :40px */
            }
            p {font-size: 2rem; /* Font-size :20px */
            }
        </style>
    </head>
    <body>
        <div>
            <p>Hello World!</p>
        </div>
    </body>
    Copy the code