Question:

How text can be highlighted in a webpage?

Show Hint

Highlighting text can improve readability and draw attention to important content on a webpage.
Updated On: Oct 8, 2025
Hide Solution
collegedunia
Verified By Collegedunia

Solution and Explanation

Text can be highlighted in a webpage using various HTML and CSS techniques. Some common methods include:

Using HTML `` tag:
The `` tag is used to highlight text by rendering it with a yellow background by default. Example:
Using CSS `background-color` property:
You can also use CSS to change the background color of text to highlight it. Example:
Using CSS classes:
Defining a CSS class for highlighting and applying it to elements. Example: \
Conclusion:
Text highlighting in webpages can be done easily using HTML tags like `` or applying CSS for more customization.

Was this answer helpful?
0
0