Div tags

A div creates a division or section within your html document. This section can wrap around any given content: text, images, video embedded in your page, and more.

A div opens with the tag <div> and closes with </div>

Div became very popular because they start by being invisible but are highly costumizable. They can take on any attribute, and about as many attributes at the same time as you wish. The most popular attributes to attach are: width, margin and padding (to control spacing), border, drop shadow (aka box-shadow), rounded corners (aka border-radius), background color, color of the type inside, spacing between the text lines (line-height). But the list really goes on and on.

They are also rather easy to establish. Just open and close when you’ve reached the end of the content you want to section together.

With the use of selectors like id and class you can quickly locate a div in your document and apply the styles from the head or even an external style sheet (CSS)

Selectors introduction