Cookie Consent by Free Privacy Policy Generator Aktuallisiere deine Cookie Einstellungen ๐Ÿ“Œ HTML Tags You Might Not Know About


๐Ÿ“š HTML Tags You Might Not Know About


๐Ÿ’ก Newskategorie: Programmierung
๐Ÿ”— Quelle: dev.to

Hello Devs๐Ÿ‘‹

In this post, I will share some new and helpful html tags which are added in HTML5 to write easy and fast code to create complex, dynamic, engaging, and effective websites.

Lets get started๐Ÿš€

dialog

โžก Now you can easily create dialog box or a popup window with <dialog> tag. Itโ€™s a great way to create custom modal dialogs without relying heavily on JavaScript.

<dialog id="myDialog">
  <p>This is a dialog box</p>
  <button onclick="document.getElementById('myDialog').close()">Close
  </button>
</dialog>
<button onclick="document.getElementById('myDialog').showModal()">Open Dialog
</button>

template

โžก The <template> tag is used as a container for holding client-side content that you donโ€™t want to display when the page loads. This content can be cloned and inserted into the document using JavaScript.

<button onclick="showContent()">Show hidden content</button>

<template>
  <h2>Hello, This is Kiran</h2>
  <p>Thanks for reading this</p>
</template>

<script>
function showContent() {
  let temp = document.getElementsByTagName("template")[0];
  let clon = temp.content.cloneNode(true);
  document.body.appendChild(clon);
}
</script>

picture

โžก By using <picture> tag you can define multiple sources for an image, now the browser choose the best one based on screen size, resolution. This is particularly useful for responsive design.

<picture>
  <source media="(min-width:650px)" srcset="img_pink_flowers.jpg">
  <source media="(min-width:465px)" srcset="img_white_flower.jpg">
  <img src="img_orange_flowers.jpg" alt="Flowers" style="width:auto;">
</picture>

meter

โžก The <meter> tag can be used for representing a scalar measurement within a known range, like disk usage or the relevance of a query result. It helps to visually display values within a range.

<label for="diskUsage">Disk Usage:</label>
<meter id="diskUsage" value="0.6">60%</meter>

output

โžก The <output> tag represents the result of a calculation. It can be used with JavaScript to display the result of a calculation.

<form oninput="result.value=parseInt(a.value)+parseInt(b.value)">
  <input type="number" id="a" value="50"> +
  <input type="number" id="b" value="25"> =
  <output name="result" for="a b">75</output>
</form>

progress

โžก The <progress> tag represents the completion progress of a task, such as a download or file upload.

<label for="fileProgress">File upload progress:</label>
<progress id="fileProgress" value="70" max="100">70%</progress>

mark

โžก The <mark> tag is used to highlight text. Itโ€™s particularly useful for search result pages where you want to highlight the matching text.

<p>The word <mark>highlighted</mark> is important.</p>

abbr

โžก The <abbr> tag is used to define an abbreviation or acronym, providing a full description in the title attribute.

<p>I'm a true<abbr title="Marvel Cinematic Universe">MCU</abbr>fan.</p>

time

โžก The <time> tag is used to represent dates, times, or durations. Itโ€™s useful for making your time-related data machine-readable.

<p>The concert starts at <time datetime="20:00">8 PM</time>.</p>

bdi

โžก The <bdi> tag is used to isolate a part of text that might be formatted in a different direction from other text outside it. It ensures that your web content remains consistent and readable, no matter what languages or text directions are involved.

<ul>
  <li>Product: <bdi>ABC1234</bdi></li>
  <li>Product: <bdi>ู…ุฑุญุจุง5678</bdi></li>
</ul>

wbr

โžก The <wbr> tag specifies where the text can break into a new line, if necessary. This is useful for long words or URLs.

<p>Thisisaverylongword<wbr>thatmightneedbreaking.</p>

main

โžก The <main> tag is used to specify the main content of the document. It should only be used once per page, and it excludes content that is repeated across documents like headers, footers, navigation, and sidebars.

<main>
  <h1>Welcome to my blog post</h1>
  <p>Today we will learn some new html tags</p>
</main>

figcaption

โžก The <figcaption> tag is used for providing a caption to the figure.

<figure>
  <img src="Thanos.jpg" alt="Thanos image">
  <figcaption>Thanos snapping his fingers</figcaption>
</figure>

That's it for this article.๐Ÿ‘

Thank you for readingโค

Find Me on ๐Ÿ‘‰ X GitHub

...



๐Ÿ“Œ HTML Tags You Might Not Know About


๐Ÿ“ˆ 42.49 Punkte

๐Ÿ“Œ The 7 HTML Tags You Most Probably Do Not Know


๐Ÿ“ˆ 33.33 Punkte

๐Ÿ“Œ The 7 HTML Tags You Most Probably Do Not Know


๐Ÿ“ˆ 33.33 Punkte

๐Ÿ“Œ The More You Know, The More You Know You Donโ€™t Know (Project Zero)


๐Ÿ“ˆ 30.27 Punkte

๐Ÿ“Œ Top To Down, Left To Right (aka What Do You Not Know You Do Not Know About Python?)


๐Ÿ“ˆ 30.14 Punkte

๐Ÿ“Œ 5 Unsung HTML Tags You Really Should Know๐Ÿค”


๐Ÿ“ˆ 28.35 Punkte

๐Ÿ“Œ Less Common HTML Tags You Should Know โ€“ With Example Code


๐Ÿ“ˆ 28.35 Punkte

๐Ÿ“Œ Piwigo up to 2.9.2 Administration Panel admin/tags.php tags sql injection


๐Ÿ“ˆ 28 Punkte

๐Ÿ“Œ LinkDesk Smart Tags vorgestellt: Schicke NFC-Tags mit App-Anbindung


๐Ÿ“ˆ 28 Punkte

๐Ÿ“Œ Piwigo bis 2.9.2 Administration Panel admin/tags.php tags SQL Injection


๐Ÿ“ˆ 28 Punkte

๐Ÿ“Œ LinkDesk Smart Tags vorgestellt: Schicke NFC-Tags mit App-Anbindung


๐Ÿ“ˆ 28 Punkte

๐Ÿ“Œ 11 things you might not know about security operations center burnout


๐Ÿ“ˆ 24.23 Punkte

๐Ÿ“Œ 5 Privacy Risks You Might Not Know About


๐Ÿ“ˆ 24.23 Punkte

๐Ÿ“Œ Is Your Company Actually Secure? 6 Security Risks You Might Not Know About


๐Ÿ“ˆ 24.23 Punkte

๐Ÿ“Œ 3 Famous Commerce Data Breaches You Might Not Know About And How To Avoid Becoming A Victim Of One


๐Ÿ“ˆ 24.23 Punkte

๐Ÿ“Œ 27 Useful Windows Command Prompt Tricks You Might Not Know


๐Ÿ“ˆ 24.23 Punkte

๐Ÿ“Œ Top 20 Things You Might Not Know About Cyber Security, Ethical Hacking, Linux


๐Ÿ“ˆ 24.23 Punkte

๐Ÿ“Œ 10 Things You Might Not Know About Cyber Essentials


๐Ÿ“ˆ 24.23 Punkte

๐Ÿ“Œ 3 things you might not know about modern ransomware and how Nefilim makes money


๐Ÿ“ˆ 24.23 Punkte

๐Ÿ“Œ Facts You Might Not Know About The Dark Web


๐Ÿ“ˆ 24.23 Punkte

๐Ÿ“Œ 9 Common JavaScript Interview Questions You Might Not Know The Answer For.


๐Ÿ“ˆ 24.23 Punkte

๐Ÿ“Œ Z-Index Trick You Might Not Know ๐Ÿš€


๐Ÿ“ˆ 24.23 Punkte

๐Ÿ“Œ 6 useful CSS features you might not know about


๐Ÿ“ˆ 24.23 Punkte

๐Ÿ“Œ Reasons you might not know why there are two, a local and a session storage.


๐Ÿ“ˆ 24.23 Punkte

๐Ÿ“Œ Finding all HTML tags in a project not being self-closed


๐Ÿ“ˆ 23.24 Punkte

๐Ÿ“Œ Do You Know Cobol? If So, There Might Be a Job for You.


๐Ÿ“ˆ 22.82 Punkte

๐Ÿ“Œ HTML Tips - Less Known HTML Tags and Attributes โ™ฅ๏ธ


๐Ÿ“ˆ 22.52 Punkte

๐Ÿ“Œ You better watch out, you better not cry. Better not pout, I'm telling you why: SQLite vuln fixes are coming to town


๐Ÿ“ˆ 20.66 Punkte

๐Ÿ“Œ You Donโ€™t Know What You Donโ€™t Know: 5 Best Practices for Data Discovery and Classification


๐Ÿ“ˆ 20.18 Punkte











matomo