Why div? What is it and what is it for?

[codebyte]

Hello World

This paragraph is a child of the body element

This paragraph is a child of the div element and a grandchild of the body element

*You must select a tag to post in this category. Please find the tag relating to the section of the course you are on E.g. Forms, Structure**

When you ask a question, don’t forget to include a link to the exercise or project you’re dealing with!

If you want to have the best chances of getting a useful answer quickly, make sure you follow our guidelines about how to ask a good question. That way you’ll be helping everyone – helping people to answer your question and helping others who are stuck to find the question and answer! :slight_smile:
[/codebyte]

Hey, @script1577769937 welcome to the forums.

Please format your code otherwise, we can not help you. And also please tell us what you are having trouble with.

What is div? What does it do?

Div is just a tag that defines a division or a section in an HTML document. Usually it is used as a container for other elements which is very useful when you want to add CSS or JavaScript.

1 Like