HTML5: How to define a part of text in an alternate voice or mood?
Solution:
HTML Code:
<!DOCTYPE html><!-- Declaration specifying the document type -->
<html><!-- Opening tag for the root element of the HTML document -->
<head><!-- Opening tag for the document's header section -->
<meta charset="utf-8"><!-- Metadata tag specifying the character encoding of the document -->
<title>How to define a part of text in an alternate voice or mood</title><!-- Title of the HTML document -->
</head><!-- Closing tag for the document's header section -->
<body><!-- Opening tag for the document's body section -->
<p><!-- Opening tag for a paragraph element -->
<i>W3resource</i> is very informative and easy to learn tutorial for the beginners</p><!-- Italics tag applied to the text "W3resource" -->
</body><!-- Closing tag for the document's body section -->
</html><!-- Closing tag for the root element of the HTML document -->
Explanation:
- This HTML code demonstrates how to define a part of text in an alternate voice or mood using the <i> (italic) element.
- The <i> element is used to apply italics to the enclosed text, which typically represents text in a different tone or mood.
- In this example, the text "W3resource" is wrapped in <i> tags to display it in italics.
- The rest of the text remains unaffected and is displayed in the default font style.
Live Demo:
See the Pen i-answer by w3resource (@w3resource) on CodePen.
See the solution in the browser
Supported browser
Yes | Yes | Yes | Yes | Yes |
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics