WSU HTML Cheat Sheet PDF
WSU HTML Cheat Sheet PDF
WSU HTML Cheat Sheet PDF
BEGINNER’S_
HTML CHEAT SHEET
Main root 2
Document metadata 2
Sectioning root 3
Content sectioning 3
Text content 4
Scripting 9
Demarcating edits 9
Table content 9
Forms 11
Document metadata
<head> … </head>
The HTML <head> element contains machine-readable information (metadata) about the
document, like its title, scripts, and style sheets.
<link>
The HTML External Resource Link element (<link>) specifies relationships between the current
document and an external resource. This element is most commonly used to link to stylesheets,
but is also used to establish site icons (both "favicon" style icons and icons for the home screen
and apps on mobile devices) among other things.
<meta>
The HTML <meta> element represents metadata that cannot be represented by other HTML
meta-related elements, like <base>, <link>, <script>, <style> or <title>
<style> … </style>
The HTML <style> element contains style information for a document, or part of a document.
<title> … </title>
The HTML Title element (<title>) defines the document's title that is shown in a browser's title
bar or a page's tab.
Example:
Sectioning root
<body> … </body>
The HTML <body> Element represents the content of an HTML document. There can be only
one <body> element in a document.
Example:
<html>
<head>
<title>Document title</title>
</head>
<body>
<p>This is a paragraph</p>
</body>
</html>
Content sectioning
<address> … </address>
The HTML <address> element indicates that the enclosed HTML provides contact information
for a person or people, or for an organization.
<article> … </article>
The HTML <article> element represents a self-contained composition in a document, page,
application, or site, which is intended to be independently distributable or reusable (e.g., in
syndication).
<aside> … </aside>
The HTML <aside> element represents a portion of a document whose content is only indirectly
related to the document's main content.
<footer> … </footer>
The HTML <footer> element represents a footer for its nearest sectioning content or sectioning
root element. A footer typically contains information about the author of the section, copyright
data or links to related documents.
Text content
<blockquote> … </blockquote>
The HTML <blockquote> Element (or HTML Block Quotation Element) indicates that the
enclosed text is an extended quotation. Usually, this is rendered visually by indentation (see
Notes for how to change it). A URL for the source of the quotation may be given using the cite
attribute, while a text representation of the source can be given using the <cite> element.
<dd> … </dd>
The HTML <dd> element provides the description, definition, or value for the preceding term
(<dt>) in a description list (<dl>).
<figure>
<img src="/media/examples/elephant-660-480.jpg"
alt="Elephant at sunset">
<figcaption>An elephant at sunset</figcaption>
</figure>
<ol>
<li>Mix flour, baking powder, sugar, and salt.</li>
<li>In another bowl, mix eggs, milk, and oil.</li>
<li>Stir both mixtures together.</li>
<li>Fill muffin tray 3/4 full.</li>
<li>Bake for 20 minutes.</li>
</ol>
<figure>
<figcaption>Listen to the T-Rex:</figcaption>
<audio
controls
src="/media/examples/t-rex-roar.mp3">
Your browser does not support the
<code>audio</code> element.
</audio>
</figure>
Scripting
<script> … </script>
The HTML <script> element is used to embed or reference executable code; this is typically
used to embed or refer to JavaScript code.
Example:
<!-- HTML4 -->
<script type="text/javascript" src="javascript.js"></script>
Demarcating edits
<del> … </del>
The HTML <del> element represents a range of text that has been deleted from a document.
<ins> … </ins>
The HTML <ins> element represents a range of text that has been added to a document.
Example:
<p>“You're late!”</p>
<del>
<p>“I apologize for the delay.”</p>
</del>
<ins cite="../howtobeawizard.html" datetime="2018-05">
<p>“A wizard is never late …”</p>
</ins>
Table content
<caption> … </caption>
The HTML Table Caption element (<caption>) specifies the caption (or title) of a table, and if
used is always the first child of a <table>.
Interactive elements
<details> … </details>
The HTML Details Element (<details>) creates a disclosure widget in which information is
visible only when the widget is toggled into an "open" state.
<summary> … </summary>
The HTML Disclosure Summary element (<summary>) element specifies a summary, caption, or
legend for a <details> element's disclosure box.
Example:
<details>
<summary>Details</summary>
Something small enough to escape casual notice.
</details>
Source: https://developer.mozilla.org/en-US/docs/Web/HTML/Element