HTML Highlight Text: Main Tips
- HTML
mark
tags are used to highlight important portions of text. - It was newly introduced in HTML5.
- You must use both starting and ending HTML highlight text tags.
- Easy to use with a learn-by-doing approach
- Offers quality content
- Gamified in-browser coding experience
- The price matches the quality
- Suitable for learners ranging from beginner to advanced
- Free certificates of completion
- Focused on data science skills
- Flexible learning timetable
- Simplistic design (no unnecessary information)
- High-quality courses (even the free ones)
- Variety of features
- Nanodegree programs
- Suitable for enterprises
- Paid Certificates of completion
- A wide range of learning programs
- University-level courses
- Easy to navigate
- Verified certificates
- Free learning track available
- University-level courses
- Suitable for enterprises
- Verified certificates of completion
Using mark Tags
To make HTML highlight text, you need to surround it with <mark>
tags:
<p>The mark tag is <mark>useful</mark> when you need to highlight important information.</p>
Understanding how to highlight text in HTML comes in handy when you need to convey that some content has more relevance than the rest. The most common case of using it is highlighting search results.
The browser will display the content of HTML mark
tags using these CSS settings:
Note: most screen readers don't announce the presence of HTML mark element by default. You can change it using the CSS content property.