Elements & Attributes
- Elements have an opening tag, content, and a closing tag: <p>...</p>
- Attributes add extra info: <img src="cat.jpg" alt="cat">
- Void elements have no closing tag: <br>, <img>, <meta>, <input>
- Proper nesting matters: tags must close in order.
Try it
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Elements Demo</title>
</head>
<body>
<h1 id="title" class="main">Article Title</h1>
<p>Inline <strong>bold</strong> and <em>emphasis</em>.</p>
<img src="https://picsum.photos/300/120" alt="Random" />
<br>
<input type="text" placeholder="Your name" />
</body>
</html>