📘 HTML5 & CSS Cheatsheet

Element Description Example
<!DOCTYPE html> Defines the document type and HTML version. <!DOCTYPE html> <html> <head> <title>Document Title</title> </head> <body> Document body here </body> </html>
<a href> Creates a hyperlink to another page. <a href="https://example.com">Visit</a>
<article> A self-contained piece of content. <article> <h2>HTML</h2> <p>Hypertext Markup Language</p> </article>
<aside> Content related to the main content. <aside> Additional content here. </aside>
<body> Contains visible page content. <body> Page content here </body>
<div> Generic block-level container for styling. <div> Content here </div>
<form> & <fieldset> Form for user input, with grouped fields. <form> <fieldset> <legend>User Info</legend> <input type="text"> </fieldset> </form>
<figure> & <figcaption> Image with caption. <figure> <img src="img.jpg" /> <figcaption>Caption</figcaption> </figure>
<header> Introductory section of a page. <header> <h1>Welcome</h1> </header>