HTML Cheatsheet
HTML Cheatsheet
HTML Boilerplate
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<!-- Your Content -->
</body>
</html>
The <!DOCTYPE html> declaration defines that this document is an HTML5 document
The <html> element is the root element of an HTML page
The <head> element contains meta information about the HTML page
The <title> element specifies a title for the HTML page (which is shown in the browser's title bar or in
D
An HTML element is defined by a start tag, some content, and an end tag:
<tagname> Content goes here... </tagname>
es
Headings
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
Visual Representation:
D
ee
_c
od
Containers
es
html
Copy code
<div>This is a div block</div>
html
Copy code
<span>This is a span block</span>
p: Paragraph
html
Copy code
<p>This is a paragraph</p>
html
Copy code
<pre>This is preformatted text</pre>
Visual representation:
Text Formatting
<b>Bold text</b>
<strong>Important text</strong>
<i>Italic text</i>
D
<em>Emphasized text</em>
ee
<sub>Subscript text</sub>
<sup>Superscript text</sup>
_c
Visual Representation:
od
Bold text
Important text
Italic text
es
Emphasized text
Subscript text₂
Superscript text²
Lists
<ol>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ol>
<ul>
<li>Bullet 1</li>
<li>Bullet 2</li>
</ul>
Media
Audio
<audio controls>
<source src="audio.mp3" type="audio/mpeg">
</audio>
D
ee
_c
od
Video
es
</tr>
</tbody>
ee
</table>
_c
od
es
<label for="name">Name:</label>
<input type="text" id="name" name="name">
<input type="submit" value="Submit">
</form>
Password:
D
File Upload:
<input type="file" name="fileupload">
od
es
Meta Tags
<meta name="description" content="Page description">
<meta name="author" content="Author name">
<meta name="keywords" content="HTML, CSS, JavaScript">
Comments
html
Copy code
<!-- This is a comment -->
es
od
_c
ee
D