What is an HTML Element?
An HTML element is everything from the opening tag to the closing tag, including the content in between
Example:
<h1>Hello World</h1>
Here:
<h1> is the start tag
Hello World is the content
</h1> is the end tag
Types of HTML Elements
Inline Elements
-
Only take up as much space as needed
-
Stay on the same line as other content
-
Examples:
<span>
,<a>
,<img>
,<strong>
Block-level Elements
-
Take up the full width of the page
-
Always start on a new line
-
Examples:
<div>
,<p>
,<h1>
to<h6>
,<section>
,<article>