HTML (Hypertext Markup Language) elements are usually either "block-level" elements or "inline" elements. A block-level element occupies the entire space of its parent element (container), thereby creating a "block." This article helps to explain what this means.html
Browsers typically display the block-level element with a newline both before and after the element. You can visualize them as a stack of boxes. The following example demonstrates the block-level element's influence:web
<p>This paragraph is a block-level element; its background has been colored to display the paragraph's parent element.</p>
p { background-color: #8ABB55; }
<body>
element.There are a couple of key differences between block-level elements and inline elements:canvas
Formattingapp
By default, block-level elements begin on new lines, but inline elements can start anywhere in a line.ide
Content modelthis
Generally, block-level elements may contain inline elements and other block-level elements. Inherent in this structural distinction is the idea that block elements create "larger" structures than inline elements.idea
The distinction of block-level vs. inline elements is used in HTML specifications up to 4.01. In HTML5, this binary distinction is replaced with a more complex set of content categories. The "block-level" category roughly corresponds to the category of flow content in HTML5, while "inline" corresponds to phrasing content, but there are additional categories.spa
The following is a complete list of all HTML block level elements (although "block-level" is not technically defined for elements that are new in HTML5).code
Contact information.
Article content.
Aside content.
Long ("block") quotation.
Drawing canvas.
Describes a term in a description list.
Document division.
Description list.
Description list term.
Field set label.
Figure caption.
Groups media content with a caption (see <figcaption>
).
Section or page footer.
Input form.
<h1>
, <h2>
, <h3>
, <h4>
, <h5>
, <h6>
Heading levels 1-6.
Section or page header.
Groups header information.
Horizontal rule (dividing line).
List item.
Contains the central content unique to this document.
Contains navigation links.
Content to use if scripting is not supported or turned off.
Ordered list.
Form output.
Paragraph.
Preformatted text.
Section of a web page.
Table.
Table footer.
Unordered list.
Video player.