A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.w3resource.com/html-css-exercise/css-properties/text-transform-answer.php below:

Website Navigation


CSS Properties: How to change cases of text in paragraphst

CSS Properties: How to change cases of text in paragraphstLast update on February 24 2024 12:26:54 (UTC/GMT +8 hours)

Go to Exercise page

Solution:

HTML Code:

<!DOCTYPE html><!-- Declares the document type and version of HTML -->
<html><!-- Begins the HTML document -->
<head><!-- Contains metadata and links to external resources -->
<title>How to change cases of text in paragraphs</title><!-- Sets the title of the document -->
<style type="text/css"> /* Starts CSS styling */
p.capitalize { /* Styles paragraphs with the class "capitalize" */
    text-transform: capitalize; /* Transforms text to capitalize the first character of each word */
}
p.uppercase { /* Styles paragraphs with the class "uppercase" */
    text-transform: uppercase; /* Transforms text to uppercase */
}
p.lowercase { /* Styles paragraphs with the class "lowercase" */
    text-transform: lowercase; /* Transforms text to lowercase */
}
</style><!-- Ends CSS styling -->
</head><!-- Ends the head section -->
<body><!-- Begins the body of the document -->
<h1><strong>w3resource Tutorial</strong></h1><!-- Displays a level 1 heading with bold text "w3resource Tutorial" -->
<h3>Text transform: capitalize</h3><!-- Displays a level 3 heading indicating the text transformation -->
<p class="capitalize">web development tutorial </p><!-- Displays a paragraph with the class "capitalize" and applies text capitalization -->
<h3>Text transform: uppercase</h3><!-- Displays a level 3 heading indicating the text transformation -->
<p class="uppercase">web development tutorial </p><!-- Displays a paragraph with the class "uppercase" and applies text uppercase -->
<h3>Text transform: lowercase</h3><!-- Displays a level 3 heading indicating the text transformation -->
<p class="lowercase">web development tutorial </p><!-- Displays a paragraph with the class "lowercase" and applies text lowercase -->
</body><!-- Ends the body section -->
</html><!-- Ends the HTML document -->

Explanation:

Live Demo:

See the Pen text-transform-answer by w3resource (@w3resource) on CodePen.

See the solution in the browser

Supported browser

Go to Exercise page

What is the difficulty level of this exercise?

Test your Programming skills with w3resource's quiz.




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4