The Div Tag

Moving into the next section, you'll be seeing something called the a div tag popping up quite often.

Div tags basically function as a way to separate your page into sections you can then reference later.

Div Example - Each section can be colored separately

Div tags look like this: <div>

div.html
<!DOCTYPE html>
<html>
    <body>
        <div>
            <p>
                Hello there!!
            </p>
        </div>
    </body>
</html>

Exercises

  1. Create a document called div.html. Using the code above as a guide, create a div using the above sample as a guide.

Last updated

Was this helpful?