03. HTML Elements Types
September 21, 2024Less than 1 minute
Block Type.
A block-level element always starts on a new line, and the browsers automatically add some space (a margin) before and after the element.
A block-level element always takes up the full width available (stretches out to the left and right as far as it can).
<address>
<article>
<aside>
<blockquote>
<canvas>
<dd>
<div>
<dl>
<dt>
<fieldset>
<figcaption>
<figure>
<footer>
<form>
<h1>-<h6>
<header>
<hr>
<li>
<main>
<nav>
<noscript>
<ol>
<p>
<pre>
<section>
<table>
<tfoot>
<ul>
<video>
Inline Type
An inline element does not start on a new line.
An inline element only takes up as much width as necessary.
<a>
<abbr>
<acronym>
<b>
<bdo>
<big>
<br>
<button>
<cite>
<code>
<dfn>
<em>
<i>
<img>
<input>
<kbd>
<label>
<map>
<object>
<output>
<q>
<samp>
<script>
<select>
<small>
<span>
<strong>
<sub>
<sup>
<textarea>
<time>
<tt>
<var>
- The block elemnts can contain all kinds of elements, include block elements and inline elements.
- The inline elements can only inline elements, the block elements cannot appear in inline elemnts.
- Headers (h1~h6) cannot be nested within each other.
- Tag
p
cannot contain block elemnts.