How to define marked/highlighted text using HTML5 ?
Last Updated :
30 May, 2022
In the article, we define a marked/highlighted text by using the mark tag in HTML is used to define the marked text. It is used to highlight the part of the text in a paragraph. The mark tag is new in HTML 5. Syntax:
<mark> Contents... </mark>
Examples:
html
<!DOCTYPE html>
< html >
< head >
< title >How to define marked/highlighted text</ title >
< style >
body {
text-align:center;
}
h1 {
color:green;
}
</ style >
</ head >
< body >
< h1 >GeeksforGeeks</ h1 >
< h2 >< mark >HTML5: How to define marked/highlighted text
</ mark ></ h2 >
< p >
< mark >GeeksforGeeks:</ mark >
It is a
< mark >computer science</ mark >
portal for geeks
</ p >
</ body >
</ html >
|
Output: Supported Browsers are listed below:
- Google Chrome
- Internet Explorer
- Firefox
- Opera
- Safari
Share your thoughts in the comments
Please Login to comment...