HTML elements you might not know
Since I created a component library called Taslonic, I have been discovering how native HTML is more powerful than I imagined. How versatile it is. How harmonious is its integration to the operating system of any device. In brief words, how much this technology, often underestimated, can leverage our productivity by saving us from writing hundreds of lines of code.
See below some native HTML elements which you might not have been introduced to yet.
Details
It disclosures additional information or form controls.
Transaction details
- Descriptions:
- Lifetime license | Typenik
- Date:
- Apr 29, 2023
- Price:
- $9
<details>
<summary>Transaction details</summary>
<dl>
<dt>Descriptions:</dt>
<dd>
Lifetime license |
<a href="https://typenik.compilorama.com/" rel="noreferrer noopener" target="_blank">
Typenik
</a>
</dd>
<dt>Date:</dt> <dd>Apr 29, 2023</dd>
<dt>Price:</dt> <dd>$9</dd>
</dl>
</details>
Edit this code. Docs for Details.
Browser Support
Browser | Since | Version |
---|---|---|
Chrome | Jun, 6 2011 | 69 |
Firefox | Sep, 19 2016 | 110 |
Safari | Jul, 24 2012 | 12.1 |
Edge | Jan, 14 2020 | 79 |
Dialog
It is a temporary component of an application which users interact with to carry out a specific task or obtain information. When the user is finished, the dialog box can either be automatically closed by the application or manually closed by the user.
<button onclick="nativeDialog.showModal()">
Open Dialog
</button>
<dialog id="nativeDialog">
<p>Native HTML Dialog</p>
<form method="dialog">
<button type="submit">Dismiss</button>
</form>
</dialog>
Edit this code. Docs for Dialog.
Browser Support
Browser | Since | Version |
---|---|---|
Chrome | Aug, 25 2014 | 37 |
Firefox | Mar, 7 2022 | 98 |
Safari | Mar, 13 2022 | 15.4 |
Edge | Jan, 14 2020 | 79 |
Math
It is used to express mathematical notations and is filled with a set of especific elements specified by the MathML (Mathematical Markup Language).
<math>
<mi>x</mi>
<mo>=</mo>
<mfrac>
<mrow>
<mo>-</mo>
<mi>b</mi>
<mo>±</mo>
<msqrt>
<msup>
<mrow>
<mi>b</mi>
</mrow>
<mn>2</mn>
</msup>
<mo>-</mo>
<mi>4</mi>
<mi>a</mi>
<mi>c</mi>
</msqrt>
</mrow>
<mrow>
<mi>2</mi>
<mi>a</mi>
</mrow>
</mfrac>
</math>
Edit this code. Docs for Math.
Browser Support
Browser | Since | Version |
---|---|---|
Chrome | Jan, 10 2023 | 109 |
Firefox | Mar, 22 2011 | 4 |
Safari | Jul, 20 2011 | 5.1 |
Edge | Jan, 12 2023 | 109 |
Meter
It represents the current measure within a known range. For example, storage usage, statistical confidence interval, performance, among other cases.
<label for="fuel">Fuel level</label>
<meter
id="fuel"
min="0"
max="100"
low="10"
high="80"
optimum="85"
value="50"
>
at 50/100
</meter>
Edit this code. Docs for Meter.
Browser Support
Browser | Since | Version |
---|---|---|
Chrome | Dez, 1 2010 | 8 |
Firefox | Aug, 27 2012 | 16 |
Safari | Jul, 24 2012 | 6 |
Edge | Nov, 11 2015 | 13 |
Progress
It represents the completion progress of a task.
<label for="reviewedArticles">
Reviewed articles
</label>
<progress
id="reviewedArticles"
min="0"
max="100"
value="70"
>
70%
</progress>
Edit this code. Docs for Progress.
Browser Support
Browser | Since | Version |
---|---|---|
Chrome | Dez, 1 2010 | 8 |
Firefox | Aug, 15 2011 | 6 |
Safari | Jul, 24 2012 | 6 |
Edge | Jul, 28 2015 | 12 |
HTML is an involving technology, evolves rapidly and, above all, it has shown me that may be already available some component I'd start to implement from scratch.