Member-only story
10 Html Tags Probably You Don’t Know
As web developers, we’re all familiar with the basics of HTML — div
, span
, p
, and the like. But did you know there are many other HTML tags that can help you create more semantic, accessible, and engaging web pages?
Let’s dive into some lesser-known HTML tags, their usage, and examples to get you started.
details
and summary
The <details>
tag creates a collapsible element while <summary>
providing a summary or button to expand and collapse the content. This is perfect for FAQs, tutorials, or any content that requires a hide/show mechanism without relying on JavaScript.
Why Use It?
- Enhances user experience by organizing content.
- Requires no JavaScript for toggling visibility.
Example:
<details>
<summary>What is HTML?</summary>
HTML stands for HyperText Markup Language, used for structuring web pages.
</details>
mark
The <mark>
tag highlights text, making it stand out from the rest of the content. This is useful for drawing attention to important information or search…