Why use a div?

I was thinking about when to use a div over another tag. You want to use a div to divide your page and create sections. Often you run into a situation where you’re not really creating a whole new section but you need a tag to mark up an element.

It occurred to me that I use the div tag when the element will contain more than one type of content. For examples, pictures and text. I use the paragraph or other tag when the element contains only one type of content.

Leave a Reply

Your email address will not be published. Required fields are marked *