HTML div tag

The HTML <div> tag is used for defining a section of your document. With the <div> tag, you can combine other HTML elements into one logical group.

The basic tag is written like this <div></div> with its contents/other HTML elements inserted between the opening and closing tags.

In HTML 5 the <div> element’s role has diminished somewhat. By that, I mean that HTML 5 has introduced new elements that perform the role that the <div> was traditionally used for. In particular, when marking up a document using HTML 5, the <article>, <aside>, <header>, and <footer> elements should be used in cases where the <div> would have previously been used. So the <div> tag should generally be used as an extension mechanism which is used only if there isn’t another suitable HTML element to use.

Also see the <span> tag for use with inline elements.

<div style="width:50%;background-color:#FDFDDB;border:3px solid #C4C401;padding:5px;">
<p><q>Happiness often sneaks in through a door you didn't know you left open.</q> said <cite>John Barrymore</cite></p>

Eg. :

Happiness often sneaks in through a door you didn’t know you left open. said John Barrymore