HTML Syntax Overview
HTML Syntax Overview
Basic Structure
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<!-- Content goes here -->
</body>
</html>
Text Elements
<h1>Heading 1</h1> to <h6>Heading 6</h6>
<p>Paragraph text</p>
<br> <!-- Line break -->
<hr> <!-- Horizontal rule -->
<strong>Bold text</strong>
<em>Italic text</em>
<mark>Highlighted text</mark>
<sub>Subscript</sub> and <sup>Superscript</sup>
<pre>Preformatted text</pre>
Lists
<ul> <!-- Unordered list -->
<li>Bullet point</li>
</ul>
Tables
<table>
<thead>
<tr>
<th>Header</th>
</tr>
</thead>
<tbody>
<tr>
<td>Cell</td>
</tr>
</tbody>
</table>
Forms
<form action="/submit" method="post">
<input type="text" name="username">
<input type="password" name="password">
<input type="checkbox" name="remember">
<input type="radio" name="choice">
<textarea name="message"></textarea>
<select name="options">
<option value="1">Option 1</option>
</select>
<button type="submit">Submit</button>
</form>
Semantic Elements
<header>Header content</header>
<nav>Navigation</nav>
<main>Main content</main>
<article>Article content</article>
<section>Section content</section>
<aside>Sidebar content</aside>
<footer>Footer content</footer>
Meta Information
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Page description">
<link rel="stylesheet" href="styles.css">
<script src="script.js"></script>
</head>
Media Elements
<audio src="audio.mp3" controls></audio>
<video src="video.mp4" controls></video>
<iframe src="URL"></iframe>