files/en-us/web/html/guides/cheatsheet/index.md
While using {{Glossary("HTML")}} it can be very handy to have an easy way to remember how to use HTML tags properly and how to apply them. MDN provides you with extended HTML reference documentation as well as a deep instructional set of HTML guides. However, in many cases we just need some quick hints as we go. That's the whole purpose of the cheat sheet, to give you some quick accurate ready to use code snippets for common usages.
[!NOTE] HTML tags must be used for their semantic value, not their appearance. It's always possible to totally change the look and feel of a given tag using {{Glossary("CSS")}} so, when using HTML, take the time to focus on the meaning rather than the appearance.
An "element" is a single part of a webpage. Some elements are large and hold smaller elements like containers. Some elements are small and are "nested" inside larger ones. By default, "inline elements" appear next to one another in a webpage. They take up only as much width as they need in a page and fit together horizontally like words in a sentence or books shelved side-by-side in a row. All inline elements can be placed within the <body> element.
"Block elements," on the other hand, take up the entire width of a webpage. They also take up a full line of a webpage; they do not fit together side-by-side. Instead, they stack like paragraphs in an essay or toy blocks in a tower.
<table class="standard-table"> <thead> <tr> <th scope="col">Usage</th> <th scope="col">Element</th> <th scope="col">Example</th> </tr> </thead> <tbody> <tr> <td>A simple paragraph</td> <td>{{HTMLElement("p")}}</td> <td id="p-example"> <pre class="brush: html"> <p>I'm a paragraph</p> <p>I'm another paragraph</p></pre > {{EmbedLiveSample("p-example", 100, 150)}} </td> </tr> <tr> <td>An extended quotation</td> <td>{{HTMLElement("blockquote")}}</td> <td id="blockquote-example"> <pre class="brush: html"> They said: <blockquote>The blockquote element indicates an extended quotation.</blockquote></pre > {{EmbedLiveSample("blockquote-example", 100, 100)}} </td> </tr> <tr> <td>Additional information</td> <td>{{HTMLElement("details")}}</td> <td id="details-example"> <pre class="brush: html"> <details> <summary>HTML Cheat Sheet</summary> <p>Inline elements</p> <p>Block elements</p> </details></pre > {{EmbedLiveSample("details-example", 100, 150)}} </td> </tr> <tr> <td>An unordered list</td> <td>{{HTMLElement("ul")}}</td> <td id="ul-example"> <pre class="brush: html"><ul> <li>I'm an item</li> <li>I'm another item</li> </ul></pre> {{EmbedLiveSample("ul-example", 100, 100)}} </td> </tr> <tr> <td>An ordered list</td> <td>{{HTMLElement("ol")}}</td> <td id="ol-example"> <pre class="brush: html"><ol> <li>I'm the first item</li> <li>I'm the second item</li> </ol></pre> {{EmbedLiveSample("ol-example", 100, 100)}} </td> </tr> <tr> <td>A definition list</td> <td>{{HTMLElement("dl")}}</td> <td id="dl-example"> <pre class="brush: html"><dl> <dt>A Term</dt> <dd>Definition of a term</dd> <dt>Another Term</dt> <dd>Definition of another term</dd> </dl></pre> {{EmbedLiveSample("dl-example", 100, 150)}} </td> </tr> <tr> <td>A horizontal rule</td> <td>{{HTMLElement("hr")}}</td> <td id="hr-example"> <pre class="brush: html">before<hr />after</pre> {{EmbedLiveSample("hr-example", 100, 100)}} </td> </tr> <tr> <td>Text Heading</td> <td> {{HTMLElement("Heading_Elements", "<h1>-<h6>")}} </td> <td id="h1-h6-example"> <pre class="brush: html"> <h1> This is Heading 1 </h1> <h2> This is Heading 2 </h2> <h3> This is Heading 3 </h3> <h4> This is Heading 4 </h4> <h5> This is Heading 5 </h5> <h6> This is Heading 6 </h6></pre > {{EmbedLiveSample("h1-h6-example", 100, 350)}} </td> </tr> </tbody> </table>[!NOTE] Because this cheat sheet is limited to a few elements representing specific structures or having special semantics, the
divelement is intentionally not included — because thedivelement doesn't represent anything and doesn't have any special semantics.