How to render as emphasized text using HTML ?
The <em> tag in HTML is a phrase tag and used to emphasize the text content. It is similar to <italic> tag. The main difference between these two tag is the <em> tag semantically emphasizes on the important word or section of words while <i> tag is just offset text conventionally styled in italic to show alternative mood or voice.
Note: This effect can be achieved by using CSS property.
Syntax:
<em> Contents... </em>
Example 1: This example uses <em> tag to create emphasized text.
HTML
<!DOCTYPE html> < html > < head > < title > How to render as emphasized text using HTML? </ title > </ head > < body style = "text-align: center;" > < h1 style = "color:green;" > w3wiki </ h1 > < h3 > How to render as emphasized text using HTML? </ h3 > < em >Emphasized text content</ em > </ body > </ html > |
Output:
Example 2: This example uses <em> tag with title attribute to create emphasized text.
HTML
<!DOCTYPE html> < html > < head > < title > How to render as emphasized text using HTML? </ title > </ head > < body style = "text-align: center;" > < h1 style = "color:green;" > w3wiki </ h1 > < h3 > How to render as emphasized text using HTML? </ h3 > < em title = "Emphasized text" > Emphasized text content </ em > </ body > </ html > |
Output:
Supported Browsers:
- Google Chrome
- Internet Explorer
- Firefox
- Safari
- Opera