# HTML

### Getting Started <a href="#getting-started" id="getting-started"></a>

#### hello.html <a href="#hello-html" id="hello-html"></a>

```html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>HTML5 Boilerplate</title>
</head>
<body>
    <h1>Hello world, hello QuickRef.ME!</h1>
</body>
</html>
```

Or try it out in the [jsfiddle](https://jsfiddle.net/Fechin/1e4wz20b/)

#### Comment <a href="#comment" id="comment"></a>

```html
<!-- this is a comment -->

<!--
    Or you can comment out a
    large number of lines.
-->
```

#### Paragraph <a href="#paragraph" id="paragraph"></a>

```html
<p>I'm from QuickRef.ME</p>
<p>Share quick reference cheat sheet.</p>
```

See: [The Paragraph element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/p)

#### HTML link <a href="#html-link" id="html-link"></a>

```html
<a href="https://quickref.me">QuickRef</a>
<a href="mailto:jack@abc.com">Email</a>
<a href="tel:+12345678">Call</a>
<a href="sms:+12345678&body=ha%20ha">Msg</a>
```

***

<table data-header-hidden><thead><tr><th width="59"></th><th></th><th></th></tr></thead><tbody><tr><td></td><td><code>href</code></td><td>The URL that the hyperlink points to</td></tr><tr><td></td><td><code>rel</code></td><td>Relationship of the linked URL</td></tr><tr><td></td><td><code>target</code></td><td>Link target location:<br><code>_self</code>, <code>_blank</code>, <code>_top</code>, <code>_parent</code></td></tr></tbody></table>

See: [The \<a> Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attributes)

#### Image Tag <a href="#image-tag" id="image-tag"></a>

```html
<img loading="lazy" src="https://xxx.png" alt="Describe image here" width="400" height="400">
```

***

<table data-header-hidden><thead><tr><th width="40"></th><th></th><th></th></tr></thead><tbody><tr><td></td><td><code>src</code></td><td>Required, Image location <em>(URL | Path)</em></td></tr><tr><td></td><td><code>alt</code></td><td>Describe of the image</td></tr><tr><td></td><td><code>width</code></td><td>Width of the image</td></tr><tr><td></td><td><code>height</code></td><td>Height of the image</td></tr><tr><td></td><td><code>loading</code></td><td>How the browser should load</td></tr></tbody></table>

See: [The Image Embed element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img)

#### Text Formatting Tags <a href="#text-formatting-tags" id="text-formatting-tags"></a>

```html
<b>Bold Text</b>
<strong>This text is important</strong>
<i>Italic Text</i>
<em>This text is emphasized</em>
<u>Underline Text</u>
<pre>Pre-formatted Text</pre>
<code>Source code</code>
<del>Deleted text</del>
<mark>Highlighted text (HTML5)</mark>
<ins>Inserted text</ins>
<sup>Makes text superscripted</sup>
<sub>Makes text subscripted</sub>
<small>Makes text smaller</small>
<kbd>Ctrl</kbd>
<blockquote>Text Block Quote</blockquote>
```

#### Headings <a href="#headings" id="headings"></a>

```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>
```

You should only have one h1 on your page

#### Section Divisions <a href="#section-divisions" id="section-divisions"></a>

| `<div></div>`   | Division or Section of Page Content  |
| --------------- | ------------------------------------ |
| `<span></span>` | Section of text within other content |
| `<p></p>`       | Paragraph of Text                    |
| `<br>`          | Line Break                           |
| `<hr>`          | Basic Horizontal Line                |

These are the tags used to divide your page up into sections

#### Inline Frame <a href="#inline-frame" id="inline-frame"></a>

```html
<iframe title="New York"
    width="342"
    height="306"
    id="gmap_canvas"
    src="https://maps.google.com/maps?q=2880%20Broadway,%20New%20York&t=&z=13&ie=UTF8&iwloc=&output=embed"
    scrolling="no">
</iframe>
```

**↓ Preview**

{% embed url="<https://maps.google.com/maps?ie=UTF8&iwloc=&output=embed&q=2880+Broadway,+New+York&t=&z=13>" %}

See: [The Inline Frame element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe)

#### JavaScript in HTML <a href="#javascript-in-html" id="javascript-in-html"></a>

```html
<script type="text/javascript">
    let text = "Hello QuickRef.ME";
    alert(text);
</script>
```

**External JavaScript**

```html
<body>
    ...
    
    <script src="app.js"></script>
</body>
```

#### CSS in HTML <a href="#css-in-html" id="css-in-html"></a>

```html
<style type="text/css">
    h1 {
        color: purple;
    }
</style>
```

**External stylesheet**

```html
<head>
...
<link rel="stylesheet" href="style.css"/>
</head>
```

### HTML5 Tags <a href="#html5-tags" id="html5-tags"></a>

#### Document <a href="#document" id="document"></a>

```html
<body>
  <header>
    <nav>...</nav>
  </header>
  <main>
    <h1>QuickRef.ME</h1>
  </main>
  <footer>
    <p>©2023 QuickRef.ME</p>
  </footer>
</body>
```

#### Header Navigation <a href="#header-navigation" id="header-navigation"></a>

```html
<header>
  <nav>
    <ul>
      <li><a href="#">Edit Page</a></li>
      <li><a href="#">Twitter</a></li>
      <li><a href="#">Facebook</a></li>
    </ul>
  </nav>
</header>
```

#### HTML5 Tags <a href="#html5-tags-2" id="html5-tags-2"></a>

| [article](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/article)       | Content that’s independent             |
| ---------------------------------------------------------------------------------- | -------------------------------------- |
| [aside](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/aside)           | Secondary content                      |
| [audio](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/audio)           | Embeds a sound, or an audio stream     |
| [bdi](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/bdi)               | The Bidirectional Isolate element      |
| [canvas](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas)         | Draw graphics via JavaScript           |
| [data](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/data)             | Machine readable content               |
| [datalist](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist)     | A set of pre-defined options           |
| [details](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details)       | Additional information                 |
| [dialog](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog)         | A dialog box or sub-window             |
| [embed](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/embed)           | Embeds external application            |
| [figcaption](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/figcaption) | A caption or legend for a figure       |
| [figure](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/figure)         | A figure illustrated                   |
| [footer](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/footer)         | Footer or least important              |
| [header](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/header)         | Masthead or important information      |
| [main](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/main)             | The main content of the document       |
| [mark](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/mark)             | Text highlighted                       |
| [meter](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meter)           | A scalar value within a known range    |
| [nav](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/nav)               | A section of navigation links          |
| [output](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/output)         | The result of a calculation            |
| [picture](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/picture)       | A container for multiple image sources |
| [progress](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/progress)     | The completion progress of a task      |
| [rp](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/rp)                 | Provides fall-back parenthesis         |
| [rt](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/rt)                 | Defines the pronunciation of character |
| [ruby](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ruby)             | Represents a ruby annotation           |
| [section](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/section)       | A group in a series of related content |
| [source](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/source)         | Resources for the media elements       |
| [summary](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/summary)       | A summary for the \<details> element   |
| [template](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/template)     | Defines the fragments of HTML          |
| [time](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/time)             | A time or date                         |
| [track](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/track)           | Text tracks for the media elements     |
| [video](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video)           | Embeds video                           |
| [wbr](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/wbr)               | A line break opportunity               |

#### HTML5 Video <a href="#html5-video" id="html5-video"></a>

```html
<video controls="" width="100%">
    <source src="https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4" type="video/mp4">
    Sorry, your browser doesn't support embedded videos.
</video>
```

**↓ Preview**

{% embed url="<https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4>" %}

#### HTML5 Audio <a href="#html5-audio" id="html5-audio"></a>

```html
<audio controls
    src="https://interactive-examples.mdn.mozilla.net/media/cc0-audio/t-rex-roar.mp3">
    Your browser does not support the audio element.
</audio>
```

**↓ Preview**

[**link**](https://interactive-examples.mdn.mozilla.net/media/cc0-audio/t-rex-roar.mp3)

#### HTML5 Ruby <a href="#html5-ruby" id="html5-ruby"></a>

```html
<ruby>
  汉 <rp>(</rp><rt>hàn</rt><rp>)</rp>
  字 <rp>(</rp><rt>zì</rt><rp>)</rp>
</ruby>
```

**↓ Preview**

汉hàn字zì

#### HTML5 kdi <a href="#html5-kdi" id="html5-kdi"></a>

```html
<ul>
 <li>User <bdi>hrefs</bdi>: 60 points</li>
 <li>User <bdi>jdoe</bdi>: 80 points</li>
 <li>User <bdi>إيان</bdi>: 90 points</li>
</ul>
```

**↓ Preview**

* User hrefs: 60 points
* User jdoe: 80 points
* User إيان: 90 points

#### HTML5 progress <a href="#html5-progress" id="html5-progress"></a>

```html
<progress value="50" max="100"></progress>
```

#### HTML5 mark <a href="#html5-mark" id="html5-mark"></a>

```html
<p>I Love <mark>QuickRef.ME</mark></p>
```

I Love QuickRef.ME

### HTML Tables <a href="#html-tables" id="html-tables"></a>

#### Table Example <a href="#table-example" id="table-example"></a>

```html
<table>
    <thead>
        <tr>
            <td>name</td>
            <td>age</td>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>Roberta</td>
            <td>39</td>
        </tr>
        <tr>
            <td>Oliver</td>
            <td>25</td>
        </tr>
    </tbody>
</table>
```

#### HTML Table Tags <a href="#html-table-tags" id="html-table-tags"></a>

| [\<table>](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/table)       | Defines a table                  |
| --------------------------------------------------------------------------------- | -------------------------------- |
| [\<th>](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th)             | Defines a header cell in a table |
| [\<tr>](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tr)             | Defines a row in a table         |
| [\<td>](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/td)             | Defines a cell in a table        |
| [\<caption>](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/caption)   | Defines a table caption          |
| [\<colgroup>](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/colgroup) | Defines a group of columns       |
| [\<col>](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/col)           | Defines a column within a table  |
| [\<thead>](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/thead)       | Groups the header content        |
| [\<tbody>](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tbody)       | Groups the body content          |
| [\<tfoot>](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tfoot)       | Groups the footer content        |

#### \<td> Attributes <a href="#td-attributes" id="td-attributes"></a>

| `colspan` | Number of columns a cell should span          |
| --------- | --------------------------------------------- |
| `headers` | One or more header cells a cell is related to |
| `rowspan` | Number of rows a cell should span             |

See: [td#Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/td#attributes)

#### \<th> Attributes <a href="#th-attributes" id="th-attributes"></a>

| `colspan`                                                                        | Number of columns a cell should span          |
| -------------------------------------------------------------------------------- | --------------------------------------------- |
| `headers`                                                                        | One or more header cells a cell is related to |
| `rowspan`                                                                        | Number of rows a cell should span             |
| `abbr`                                                                           | Description of the cell's content             |
| [scope](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th#attr-scope) | The header element relates to                 |

See: [th#Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th#attributes)

### HTML Lists <a href="#html-lists" id="html-lists"></a>

#### Unordered list <a href="#unordered-list" id="unordered-list"></a>

```html
<ul>
    <li>I'm an item</li>
    <li>I'm another item</li>
    <li>I'm another item</li>
</ul>
```

See: [The Unordered List element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ul)

#### Ordered list <a href="#ordered-list" id="ordered-list"></a>

```html
<ol>
    <li>I'm the first item</li>
    <li>I'm the second item</li>
    <li>I'm the third item</li>
</ol>
```

See: [The Ordered List element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ol)

#### Definition list <a href="#definition-list" id="definition-list"></a>

```html
<dl>
    <dt>A Term</dt>
    <dd>Definition of a term</dd>
    <dt>Another Term</dt>
    <dd>Definition of another term</dd>
</dl>
```

See: [The Description List element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dl)

### HTML Forms <a href="#html-forms" id="html-forms"></a>

#### Form tags <a href="#form-tags" id="form-tags"></a>

```html
<form method="POST" action="api/login">
  <label for="mail">Email: </label>
  <input type="email" id="mail" name="mail">
  <br/>
  <label for="pw">Password: </label>
  <input type="password" id="pw" name="pw">
  <br/>
  <input type="submit" value="Login">
  <br/>
  <input type="checkbox" id="ck" name="ck">
  <label for="ck">Remember me</label>
</form>
```

**↓ Preview**

Email: \
Password: \
\
&#x20;Remember me

The HTML `<form>` element is used to collect and send information to an external source.

#### Form Attribute <a href="#form-attribute" id="form-attribute"></a>

| `name`     | Name of form for scripting                                                                          |
| ---------- | --------------------------------------------------------------------------------------------------- |
| `action`   | URL of form script                                                                                  |
| `method`   | HTTP method, `POST` / `GET` *(default)*                                                             |
| `enctype`  | Media type, See [enctype](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/enctype) |
| `onsubmit` | Runs when the form was submit                                                                       |
| `onreset`  | Runs when the form was reset                                                                        |

#### Label tags <a href="#label-tags" id="label-tags"></a>

```html
<!-- Nested label -->
<label>Click me 
<input type="text" id="user" name="name"/>
</label>
```

***

```html
<!-- 'for' attribute -->
<label for="user">Click me</label>
<input id="user" type="text" name="name"/>
```

`for` in a label references an input's `id` attribute

#### Input tags <a href="#input-tags" id="input-tags"></a>

```html
<label for="Name">Name:</label>
<input type="text" name="Name" id="">
```

**↓ Preview**

Username:&#x20;

See: [HTML input Tags](https://quickref.me/html#html-input-tags)

#### Textarea tags <a href="#textarea-tags" id="textarea-tags"></a>

```html
<textarea rows="2" cols="30" name="address" id="address"></textarea>
```

**↓ Preview**

Textarea is a multiple-line text input control

#### Radio Buttons <a href="#radio-buttons" id="radio-buttons"></a>

```html
<input type="radio" name="gender" id="m">
<label for="m">Male</label>
<input type="radio" name="gender" id="f">
<label for="f">Female</label>
```

**↓ Preview**

&#x20;Male  Female

Radio buttons are used to let the user select exactly one

#### Checkboxes <a href="#checkboxes" id="checkboxes"></a>

```html
<input type="checkbox" name="s" id="soc">
<label for="soc">Soccer</label>
<input type="checkbox" name="s" id="bas">
<label for="bas">Baseball</label>
```

**↓ Preview**

&#x20;Soccer  Baseball

Checkboxes allows the user to select one or more

#### Select tags <a href="#select-tags" id="select-tags"></a>

```html
<label for="city">City:</label>
<select name="city" id="city">
    <option value="1">Sydney</option>
    <option value="2">Melbourne</option>
    <option value="3">Cromwell</option>
</select>
```

**↓ Preview**

City:          Sydney         Melbourne         Cromwell    &#x20;

A select box is a dropdown list of options

#### Fieldset tags <a href="#fieldset-tags" id="fieldset-tags"></a>

```html
<fieldset>
    <legend>Your favorite monster</legend>
    <input type="radio" id="kra" name="m">
    <label for="kraken">Kraken</label><br/>
    <input type="radio" id="sas" name="m">
    <label for="sas">Sasquatch</label>
</fieldset>
```

**↓ Preview**

Your favorite monster Kraken\
&#x20;Sasquatch

#### Datalist tags(HTML5) <a href="#datalist-tags-html5" id="datalist-tags-html5"></a>

```html
<label for="b">Choose a browser: </label>
<input list="list" id="b" name="browser"/>
<datalist id="list">
  <option value="Chrome">
  <option value="Firefox">
  <option value="Internet Explorer">
  <option value="Opera">
  <option value="Safari">
  <option value="Microsoft Edge">
</datalist>
```

**↓ Preview**

Choose a browser:&#x20;

#### Submit and Reset Buttons <a href="#submit-and-reset-buttons" id="submit-and-reset-buttons"></a>

```html
<form action="register.php" method="post">
  <label for="foo">Name:</label>
  <input type="text" name="name" id="foo">
  <input type="submit" value="Submit">
  <input type="reset" value="Reset">
</form>
```

**↓ Preview**

Name:  &#x20;

`Submit` the data to server; `Reset` to default values

### HTML input Tags <a href="#html-input-tags" id="html-input-tags"></a>

#### Input Attributes <a href="#input-attributes" id="input-attributes"></a>

The input tag is an empty element, identifying the particular type of field information to obtain from a user.

```html
<input type="text" name="?" value="?" minlength="6"	 required />
```

***

<table data-header-hidden><thead><tr><th width="40"></th><th></th><th></th></tr></thead><tbody><tr><td></td><td><code>type="…"</code></td><td>The type of data that is being input</td></tr><tr><td></td><td><code>value="…"</code></td><td>Default value</td></tr><tr><td></td><td><code>name="…"</code></td><td>Used to describe this data in the HTTP request</td></tr><tr><td></td><td><code>id="…"</code></td><td>Unique identifier that other HTML elements</td></tr><tr><td></td><td><code>readonly</code></td><td>Stops the user from modifying</td></tr><tr><td></td><td><code>disabled</code></td><td>Stops any interaction</td></tr><tr><td></td><td><code>checked</code></td><td>The radio or checkbox select or not</td></tr><tr><td></td><td><code>required</code></td><td>Being compulsory, See <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/required#example">required</a></td></tr><tr><td></td><td><code>placeholder="…"</code></td><td>Adds a temporary, See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/::placeholder#examples">::placeholder</a></td></tr><tr><td></td><td><code>autocomplete="off"</code></td><td>Disable auto completion</td></tr><tr><td></td><td><code>autocapitalize="none"</code></td><td>Disable auto capitalization</td></tr><tr><td></td><td><code>inputmode="…"</code></td><td>Display a specific keyboard, See <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode">inputmode</a></td></tr><tr><td></td><td><code>list="…"</code></td><td>The id of an associated <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist">datalist</a></td></tr><tr><td></td><td><code>maxlength="…"</code></td><td>Maximum number of characters</td></tr><tr><td></td><td><code>minlength="…"</code></td><td>Minimum number of characters</td></tr><tr><td></td><td><code>min="…"</code></td><td>Minimum numerical value on range &#x26; number</td></tr><tr><td></td><td><code>max="…"</code></td><td>Maximum numerical value on range &#x26; number</td></tr><tr><td></td><td><code>step="…"</code></td><td>How the number will increment in range &#x26; number</td></tr><tr><td></td><td><code>pattern="…"</code></td><td>Specifies a <a href="https://quickref.me/regex">Regular expression</a>, See <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern">pattern</a></td></tr><tr><td></td><td><code>autofocus</code></td><td>Be focused</td></tr><tr><td></td><td><code>spellcheck</code></td><td>Perform spell checking</td></tr><tr><td></td><td><code>multiple</code></td><td>Whether to allow <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/multiple">multiple</a> values</td></tr><tr><td></td><td><code>accept=""</code></td><td>Expected file type in <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file">file</a> upload controls</td></tr></tbody></table>

Also see: [Attributes for the \<input> element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attributes)

#### Input types <a href="#input-types" id="input-types"></a>

| `type="checkbox"` |        |
| ----------------- | ------ |
| `type="radio"`    |        |
| `type="file"`     |        |
| `type="hidden"`   |        |
| `type="text"`     |        |
| `type="password"` |        |
| `type="image"`    |        |
| `type="reset"`    |        |
| `type="button"`   | Button |
| `type="submit"`   |        |

**New Input Types in HTML5**

| `type="color"`          |   |
| ----------------------- | - |
| `type="date"`           |   |
| `type="time"`           |   |
| `type="month"`          |   |
| `type="datetime-local"` |   |
| `type="week"`           |   |
| `type="email"`          |   |
| `type="tel"`            |   |
| `type="url"`            |   |
| `type="number"`         |   |
| `type="search"`         |   |
| `type="range"`          |   |

#### Input CSS selectors <a href="#input-css-selectors" id="input-css-selectors"></a>

| `input:focus` | When its keyboard focused |
| ------------- | ------------------------- |

See: Input pseudo classes

### HTML meta Tags <a href="#html-meta-tags" id="html-meta-tags"></a>

#### Meta tags <a href="#meta-tags" id="meta-tags"></a>

The meta tag describes meta data within an HTML document. It explains additional material about the HTML.

```html
<meta charset="utf-8">
```

```html
<!-- title -->
<title>···</title>
<meta property="og:title"  content="···">
<meta name="twitter:title" content="···">
```

***

```html
<!-- url -->
<link rel="canonical"       href="https://···">
<meta property="og:url"  content="https://···">
<meta name="twitter:url" content="https://···">
```

***

```html
<!-- description -->
<meta name="description"         content="···">
<meta property="og:description"  content="···">
<meta name="twitter:description" content="···">
```

***

```html
<!-- image -->
<meta property="og:image"  content="https://···">
<meta name="twitter:image" content="https://···">
```

***

```html
<!-- ua -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
```

***

```html
<!-- viewport -->
<meta name="viewport" content="width=device-width">
<meta name="viewport" content="width=1024">
```

#### Open Graph <a href="#open-graph" id="open-graph"></a>

```html
<meta property="og:type" content="website">
<meta property="og:locale" content="en_CA">
<meta property="og:title" content="HTML cheatsheet">
<meta property="og:url" content="https://quickref.me/html">
<meta property="og:image" content="https://xxx.com/image.jpg">
<meta property="og:site_name" content="Name of your website">
<meta property="og:description" content="Description of this page">
```

Used by Facebook, Instagram, Pinterest, LinkedIn, etc.

#### Twitter Cards <a href="#twitter-cards" id="twitter-cards"></a>

```html
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@FechinLi">
<meta name="twitter:title" content="HTML cheatsheet">
<meta name="twitter:url" content="https://quickref.me/html">
<meta name="twitter:description" content="Description of this page">
<meta name="twitter:image" content="https://xxx.com/image.jpg">
```

See: [Twitter Card Documentation](https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/summary)

#### Geotagging <a href="#geotagging" id="geotagging"></a>

```html
<meta name="ICBM" content="45.416667,-75.7">
<meta name="geo.position" content="45.416667;-75.7">
<meta name="geo.region" content="ca-on">
<meta name="geo.placename" content="Ottawa">
```

See: [Geotagging](https://en.wikipedia.org/wiki/Geotagging#HTML_pages)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://nvb99.gitbook.io/me/cheat-sheet/web-development/html.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
