HTML Tutorial

The language for building web pages.

HTML Block & Inline

Block-level vs Inline Elements

Every HTML element has a default display value depending on what type of element it is. The two most common display values are block and inline.

Block-level Elements:

A block-level element always starts on a new line and takes up the full width available.

Examples: <div>, <h1>-<h6>, <p>, <form>, <header>, <footer>, <section>

Inline Elements:

An inline element does not start on a new line and only takes up as much width as necessary.

Examples: <span>, <a>, <img>, <strong>, <em>, <label>

Try It Yourself

Edit the code below and click Run to see the result live.

Source Code
Result
Topics