HTML Block/Inline Elements Tutorial with Examples
1. Inline/Block Elements
HTML elements are divided into two types which are Block-Level elements and Inline elements.
Block-level Elements
When Block-level elements display on the browser, these elements will automatically insert line breaks before and after them.

<h3>Block Element Example:</h3>
<hr/>
Tom <h1>and</h1> Jerry.
This is a full list of HTML5 Block-level elements (by default):
- <address>
- <article>
- <aside>
- <blockquote>
- <details>
- <dialog>
- <dd>
- <div>
- <dl>
- <dt>
- <fieldset>
- <figcaption>
- <figure>
- <footer>
- <form>
- <h1>
- <h2>
- <h3>
- <h4>
- <h5>
- <h6>
- <header>
- <hgroup>
- <hr>
- <li>
- <main>
- <nav>
- <ol>
- <p>
- <pre>
- <section>
- <table>
- <ul>
Note: Some defaulted elements are Block-Level elements, <div> for example. However, you can convert it into Inline Element if you apply CSS: {display: inline} to it.
div-inline-example.html
<h3>DIV (Default):</h3>
This is a <div>DIV</div> element.
<hr/>
<h3>DIV style:{display:inline}</h3>
This is a <div style='display:inline'>DIV</div> element.
Inline Elements
Inline elements usually appear in a sentence. When displaying in the browser, these elements do not automatically insert line breaks before and after them.

<h3>Inline Element Example:</h3>
<hr/>
Tom <b>and</b> Jerry.
This is a full list of HTML5 Inline elements (by default):
- <a>
- <abbr>
- <acronym>
- <audio> (if it has visible controls)
- <b>
- <bdi>
- <bdo>
- <big>
- <br>
- <button>
- <canvas>
- <cite>
- <code>
- <data>
- <datalist>
- <del>
- <dfn>
- <em>
- <embed>
- <i>
- <iframe>
- <img>
- <input>
- <ins>
- <kbd>
- <label>
- <map>
- <mark>
- <meter>
- <noscript>
- <object>
- <output>
- <picture>
- <progress>
- <q>
- <ruby>
- <s>
- <samp>
- <script>
- <select>
- <slot>
- <small>
- <span>
- <strong>
- <sub>
- <sup>
- <svg>
- <template>
- <textarea>
- <time>
- <u>
- <tt>
- <var>
- <video>
- <wbr>
Note: Some elements by default are Inline elements, <span> for example. However, you can convert it to Block-Level if you apply CSS: {display: block} to it.
span-block-example.html
<h3>SPAN (Default):</h3>
This is a <span>SPAN</span> element.
<hr/>
<h3>SPAN style:{display:block}</h3>
This is a <span style='display:block'>SPAN</span> element.
2. Div Element
<div> isa Block-level element. It is one of the most used elements and the most important one in an HTML document. It is used to contain other elements, or to participate in creating the layout of the page.
By default, <div> creates a transparent rectangular area, but you can visually see it if you apply CSS to it, for example, background, border, etc.
div-css-example.html
<!DOCTYPE html>
<html>
<head>
<title>DIV Element</title>
<meta charset="UTF-8">
</head>
<body>
<h2>DIV Css Example:</h2>
<div style="background:#eee;width:250px;padding:5px;">
<h3>HTML Tutorials</h3>
<ul>
<li>Iframe</li>
<li>Tables</li>
<li>Lists</li>
</ul>
</div>
<p>Others ...</p>
</body>
</html>
3. Span Element
<span> is an important Inline element and is heavily used in HTML documents. It is used to contain other Inline elements, or text content. <span> creates a transparent area, but you can visually see it if you apply CSS to it, for example, background, border, etc.

span-css-example.html
<!DOCTYPE html>
<html>
<head>
<title>SPAN Element</title>
<meta charset="UTF-8">
</head>
<body>
<h2>Span Css Example:</h2>
<p>
Apollo 11 was the spaceflight that landed the first humans,
<span style="background:#eee;color:blue;padding:3px;margin:2px;">
Americans <b>Neil Armstrong</b> and <b>Buzz Aldrin</b>,
on the Moon on July 20, 1969, at 20:18 UTC.
</span>
Armstrong became the first to step onto the lunar surface
6 hours later on July 21 at 02:56 UTC.
</p>
<p>...</p>
</body>
</html>
HTML Tutorials
- Introduction to HTML
- Install Atom Editor
- Install Atom HTML Preview
- Starting with HTML
- HTML Images Tutorial with Examples
- HTML Block/Inline Elements Tutorial with Examples
- HTML Editors
- Install Atom-Beautify
- HTML Styles Tutorial with Examples
- HTML Hyperlinks Tutorial with Examples
- HTML Email Links Tutorial with Examples
- HTML Paragraphs Tutorial with Examples
- HTML IFrames Tutorial with Examples
- HTML Entities Tutorial with Examples
- HTML Lists Tutorial with Examples
- HTML Tables Tutorial with Examples
- HTML Col, Colgroup Tutorial with Examples
- HTML Headings Tutorial with Examples
- HTML Quotations Tutorial with Examples
- HTML URL Encoding Tutorial with Examples
- HTML Video Tutorial with Examples
- HTML Dir Attribute Tutorial with Examples
Show More
Maybe you are interested
These are online courses outside the o7planning website that we introduced, which may include free or discounted courses.
HTML & HTML5 in 60 minutes - From Beginner To Expert
The Web Development Course: HTML5, CSS3, JavaScript
Web Development Course: HTML5 and CSS3
HTML5 : Mobile Web App Development
HTML5 for Mobile Devices
HTML5 + CSS3 + Bootstrap: The Beginner Web Design Course
HTML5 and CSS for Beginner To Expert
HTML5 And CSS3 - Build Modern Responsive Websites
Learn how to build a HTML 5 Login Framework Web Application
HTML5, CSS3 & JavaScript Workshop: Build 7 Creative Projects
Learn Construct 2: Creating a Puzzle Platformer in HTML5!
Web Design How to Create a Website HTML CSS Bootstrap
Build Responsive Website with HTML5 and CSS3
HTML5 and CSS3 For Beginners - A Complete Understanding
HTML 5 : Kick start your Web Development career with HTML 5
HTML5 Game Development - Second Edition
Creating Interactive HTML5 Video
Web Visualization with HTML5, CSS3, and JavaScript-Volume 1
Power up HTML5 with JavaScript
Build Responsive Website Using HTML5, CSS3, JS And Bootstrap
HTML 5 and CSS 3 - tricks and workarounds
Write quicker HTML5 and CSS 3; productivity hacks with emmet
Build a website HTML5 CSS3 Beginner Course
Beginner's Guide to HTML and HTML5
Mastering HTML5 Canvas
HTML & HTML5 Crash Course for Entrepreneurs
Build Real World Websites from Scratch using HTML5 and CSS3
HTML CSS Easy steps to create a web template from scratch
Web Visualization with HTML5, CSS3, and JavaScript
Ultimate HTML and CSS course for Absolute Beginners 2015
Complete HTML5 and CSS3 Course +1 Start to Finish Project
HTML5 for Beginners
Core HTML How to get online quickly HTML to HTML5
The Complete HTML5 & CSS3 Course Build Professional Websites
Learn Web Development Using HTML5 Advanced Programing
HTML5, CSS3 & Bootstrap - How to Create a Responsive Website
Responsive Web Design: HTML5 + CSS3 for Entrepreneurs 2018
HTML5 and javascript in Motion For Beginner Level course
Create Android and iOS App using HTML, CSS and JS
Learn HTML, A practical guide from scratch to HTML 5
Phonegap & Ludei - Build HTML5 CSS & JS Apps
Build an HTML5 and CSS3 Website in 35 Minutes
Master the Basics of HTML5 & CSS3: Beginner Web Development
Super HTML5 Scratch. Learn All best codes Step by step
Learn animation using CSS3, Javascript and HTML5
A Web Development Crash Course in HTML5 and CSS3
Learn Dynamic HTML5 Programming
HTML5 Game Development
HTML 5: How I made websites in HTML5
Learn HTML/HTML5/PHP/MySQL from Scratch Dynamic Websites
Show More