HTML elements are the basic building blocks of an HTML document. Each element usually has an opening tag, content, and a closing tag. Here’s a breakdown with examples of common HTML elements and their content:
1) Headings
HTML provides six levels of headings, <h1>
to <h6>
, used to define the structure and hierarchy of content on a webpage.
<!DOCTYPE html>
<html>
<head>
<title>HTML Elements Example</title>
</head>
<body>
<!– Headings –>
<h1>Main Heading</h1>
<h2>Subheading</h2>
<h3>Smaller Heading</h3>
</body>
</html>
2) Paragraphs
<p>This is a paragraph of text. HTML paragraphs are block-level elements.</p>
<p>Another paragraph with <strong>bold text</strong> and <em>italic text</em>.</p>
3) Links
<a href=”https://www.example.com” target=”_blank”>Visit Example</a>