Skip to main content

Command Palette

Search for a command to run...

Top 10 HTML Tags You Need to Know

Updated
4 min read
Top 10 HTML Tags You Need to Know
M

I'm a Student, Developer, Writer and a Tech Geek

Introduction

HTML or HyperText Markup Language, is the backbone of the World Wide Web. It provides the structure for web pages, enabling browsers to render content in a visually appealing and organized manner. While many web developers are familiar with common HTML tags like <div>, <p>, and <a>, there are lesser-known tags that can add valuable functionality and enhance the user experience. In this article, we'll explore the top 10 HTML tags that you might not be familiar with but can be quite powerful.

<details> and <summary>:

The <details> and <summary> tags work hand in hand to create an expandable section on a web page. The <details> tag defines the container, and the <summary> tag provides the visible heading or title for the collapsible content. This duo is especially useful when you want to create interactive and space-saving sections on your webpage.

<details>
  <summary>Click to reveal more</summary>
  <p>This is the hidden content that will be revealed when the user 
    clicks on the summary.</p>
</details>

<mark>:

The <mark> tag highlights text within its container, making it stand out visually. This is particularly handy when you want to emphasize or draw attention to specific parts of your content. It's a simple yet effective way to enhance the readability of your web page.

<p>Search for <mark>relevant keywords</mark> to improve your results.</p>

<cite>:

The <cite> tag is used to reference the title of a creative work, such as a book or movie. It is commonly used in conjunction with the <blockquote> tag to provide proper attribution.

<blockquote>
  <p>Knowledge is power.</p>
  <cite>Sir Francis Bacon</cite>
</blockquote>

<time>:

The <time> tag is designed to represent a specific period in time, such as a date or a time. It helps browsers understand the content's temporal context and can be particularly useful for search engines and accessibility.

<p>Article published on <time datetime="2023-12-23">December 23, 2023</time>.</p>

<wbr>:

The <wbr> tag, short for "word break opportunity," allows browsers to break a line at a specific point, enhancing the text's readability. It's constructive for long URLs or strings of characters where breaking at a specific point is desired.

<p>Thisisaverylongword<wbr>brokenintopartsforbetterreadability.</p>

<progress>:

The <progress> tag provides a visual representation of the completion progress of a task. It's an excellent choice for displaying the status of file uploads, form submissions, or any other operation with measurable progress.

<progress value="70" max="100">70%</progress>

<kbd>:

The <kbd> tag is used to define keyboard input, making it useful for documenting keyboard commands or shortcuts on a web page. It typically renders the enclosed text in a monospaced font.

<p>To save, press <kbd>Ctrl + S</kbd>.</p>

<output>:

The <output> tag represents the result of a calculation or user action. It's often used in conjunction with JavaScript to dynamically display and update the output of a script.

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

<samp>:

The <samp> tag is used to represent sample output from a computer program. It's commonly employed in documentation or tutorials to display what users can expect as a result of executing certain commands.

<p>Command: <samp>npm install package-name</samp></p>

<small>:

While the <small> tag is not entirely unknown, its usage often goes unnoticed. It is used to reduce the text size, making it perfect for disclaimers, copyright information, or any other secondary content that doesn't require immediate attention.

<small>This information is subject to change without notice.</small>

Conclusion:

These lesser-known HTML tags might not be as widely used as their more common counterparts. Still, they can certainly add valuable functionality and enhance the overall user experience on your web pages. Experiment with these tags and consider incorporating them into your projects to make your code more expressive and your content more engaging. As the web development landscape continues to evolve, exploring new and lesser-known HTML tags can give you a creative edge in designing compelling and user-friendly websites.