CSS Containers


Go to main Page

Containers in CSS

To make a professional website we use the <div> tag.

We place all the content in the div and structure the page.

We can style the containers.

We can add all elements in the div tag.

Let us make a container and style it:

Example


<!DOCTYPE html>

<head>
    <title>Document</title>
    <style>
div{
    width: 300px;
    height: 300px;
    text-align: center;
background-color: red;
color:white;
}
    </style>
</head>
<body>
    <div>
<h1>Heading</h1>
<p>Paragraph</p>
<ul>
    <li>One</li>
    <li>Two</li>
    <li>Three</li>
</ul>


    </div>
</body>
</html>