Learn HTML – Part 61 – mark Tag – Highlight Text
The HTML mark tag is used to highlight text that is important or relevant.
It displays the text with a highlighted background, usually yellow by default.
What is the mark Tag?
The mark element represents text that is marked or highlighted for reference.
It is commonly used to emphasize search results or important information.
Basic Syntax
<p>This is <mark>important</mark> text.</p>
Example – Highlighted Text
<p>
Learn HTML to build <mark>modern websites</mark> easily.
</p>
Output:
Learn HTML to build modern websites easily.
When to Use mark?
- Highlight important keywords
- Show search results
- Emphasize relevant text
- Improve readability
Styling the mark Tag
The appearance of mark can be customized using CSS.
<style>
mark {
background-color: orange;
color: white;
}
</style>
Output:
This is custom styled text.
Why Use mark?
- Draws attention to key information
- Improves user experience
- Useful for highlighting search matches
- Provides semantic meaning
The
marktag highlights important or relevant text in HTML.
Common Mistakes Beginners Make
- Using mark for styling instead of meaning
- Overusing highlights
- Confusing mark with strong or em tags
Conclusion
The HTML mark tag is used to highlight important text in a webpage.
It improves readability and helps users quickly identify key information.
What’s Next?
Now that you understand the mark tag, the next step is learning about the time tag, which is used to represent dates and times.
Next: Learn HTML – Part 62 – time Tag – Date & Time →
Series: Learn HTML Series
