Display: Block-level

Every HTML element has a default display value depending on what type of element it is. The default display value for most elements is block or inline. Block-level elements always start on a new line and take up the full width available (stretches out to the left and right as far as possible). The following tags are block-level elements:

HTML file: Displayed by browser:
<div style="border:3px solid green;">The DIV element is a block-level element.</div>

<h2 style="border:3px solid pink;">The H2 element is a block-level element.</h2>

<h4 style="border:3px solid blue;">The H4 element is a block-level element.</h4>

<h6 style="border:3px solid grey;">The H6 element is a block-level element.</h6>

<p style="border:3px solid brown;">The P element is a block-level element.</p>

<form style="border:3px solid turquoise;">The FORM element is a block-level element.</form>
The DIV element is a block-level element.

The H2 element is a block-level element.

The H4 element is a block-level element.

The H6 element is a block-level element.

The P element is a block-level element.

The FORM element is a block-level element.

Blocks are invisible and must be styled to be seen.

Back button Table of Contents Next button