CSS – Backgrounds

CSS Backgrounds: used to apply Background colors and images

  • background-color
  • background-image
  • background-repeat
  • background-position

Background-color: We apply background color to entire body hence we use

<!doctype html>
<html>
            <head>
                        <style>
                                    h1, h2, p{
                                                color : red ;
                                                text-align : center ;
                                    }
                                    body{
                                                background-color : lightblue ;
                                    }
                        </style>
            </head>
            <body>
                        <h1> Heading1 </h1>
                        <p> Paragraph1 </p>
                        <h2> Heading4 </h2>
            </body>
</html>
Scroll to Top