Draft: This page is not complete.
While using 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 an extended HTML documentation as well as a deep instructional HTML how-to. However, in many cases we just need some quick hints as we go. That's the whole purpose of the cheatsheet, to give you some quick accurate ready to use code snippets for common usages.
Remember that HTML tags must be used for their semantic, not their appearance. It's always possible to totally change the look and feel of a given tag using 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 implemented within the <body></body> tags.
|A simple link||
||A link to MDN|
|A simple image||
|A generic inline container||
p its used to style and group particular elements
|Another inline container||
span its used to differentiate a part of the content that we will work on differently
|Emphasize some text||
||You can mark a phrase in the text in italics|
|Bold some text||
||Bold a word or phrase within the text|
|Mark text as important||
|Highlight some text||
|Draw a line through irrelevant text||
|Underline a non-textual annotation||
||This is mispelled|
|Text displayed lower than normal text||
||Used to represent the small print of a document|
|Used for an address||
||Main street 67|
|Used for a textual cite||
|Text displayed higher than normal text||
|A short inline quotation||
The q element indicates a short inline quotation.
|A line break||
|Suggesting a line break||
||It is used to suggest the browser to cut the text on this site if there is not enough space to display it on the same line|
|Date in readable form||
||It is used to format the date legibly for the user, such as:|
|Text displayed in code format||
<p>This text is in normal format.</p>
<code>This text is in code format.</code>
<pre>This text is in predefined format.</pre>
This text is in normal format.
This text is in predefined format.
|Embedded Audio||<audio controls="controls" src="https://media.prod.mdn.mozit.cloud/attachments/2012/07/09/2587/81ebdf32055cc6bb8aab948b51d58d9f/AudioTest%20(1).ogg">Your browser does not support the HTML5 Audio element.</audio>|
|Embedded Audio with alternative sources||<audio controls="controls"> <source="https://mdn.mozillademos.org/files/2587/AudioTest%20%281%29.mp3" type="audio/mpeg"> <source="https://media.prod.mdn.mozit.cloud/attachments/2012/07/09/2587/81ebdf32055cc6bb8aab948b51d58d9f/AudioTest%20(1).ogg" type="audio/mpeg"> Your browser does not support Audio. </audio>|
|Embedded Video||<video controls src="https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.webm">The <code>video</code> element is unsupported.</video>|
"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.
|A simple paragraph||
I'm a paragraph
I'm another paragraph
|An extended quotation||
The blockquote element indicates an extended quotation.
|An unordered list||
|An ordered list||
|A definition list||
|A horizontal rule||
This is Heading 1
This is Heading 2
This is Heading 3
This is Heading 4
This is Heading 5
This is Heading 6