em, rem, vh, and vw units

 <!DOCTYPE html>

<html lang="en">


<head>

    <meta charset="UTF-8">

    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Size units</title>

    <style>

        html{

            font-size: 25px;

        }

        .container {

            width: 400px;

            height: 100vh;

            width: 100vw;

            font-size: 10px;

            border: 2px solid red;

        }

        h1 {

            text-align: center;

        }

        #first{

            /* font-size: 3em;

            padding: 3em; */

        }

        #second{

            /* font-size: 3rem;

            padding: 3rem; */

        }

    </style>

</head>


<body>

    <div class="container">

        <h1 id="first">This is first heading</h1>

        <h1 id="second">This is second heading</h1>

        <h1 id="third">This is second heading</h1>

    </div>

</body>


</html>

Comments

Popular posts from this blog

Transform Property In CSS

More on CSS Selectors