CSS Background COLOR Properties

This code will show you how you can set background color of a web page:



code:


<!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>Firt Smaple Page</title>
    <style>

        body{
            margin: 0;
            padding: 0;
            background-color: pink;
        }
        header{
            background-color: black;
            color: white;
            height: 50px;
            /* font-size: 25px; */
        }
        .box-1{
            height: 400px;
            width: 30%;
            background-color: skyblue;
       
        }
        .box-2{
            height: 800px;
            width: 60%;
            background-color: yellowgreen;
        }
        footer{
            background-color:black;
            height: 100px;
            color: white;
            text-align: center;
            opacity: 0.7;
        }
        </style>

</head>

<body>
    <header>
        <tr><td>Manu</td>
        <td>About</td>
        <td>Contact-us</td>
       
        </tr>
    </header>
    <section class="box-1">
        This is Box-1
    </section>
    <section class="box-2">
        This is Box-2
    </section>
    <footer> Copyright &copy; Krishan Kant Singh Gautam
        <h2>
            <p >

            </p>
        </h2>
    </footer>

</body>

</html>

0 Comments