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 specify all the font properties in one declaration</title><!-- Sets the title of the document -->
<style type="text/css"> /* Starts CSS styling */
.w3r1 { /* Defines a CSS class named w3r1 */
font: 15px "Times New Roman", Times, serif; /* Specifies all font properties in one declaration: font-size, font-family, and font-style */
}
.w3r2 { /* Defines a CSS class named w3r2 */
font: 15px Georgia, Times, serif; /* Specifies all font properties in one declaration for class w3r2 */
}
.w3r3 { /* Defines a CSS class named w3r3 */
font: 15px "Courier New", Courier, monospace; /* Specifies all font properties in one declaration for class w3r3 */
}
.w3r4 { /* Defines a CSS class named w3r4 */
font: 15px Arial, Helvetica, sans-serif; /* Specifies all font properties in one declaration for class w3r4 */
}
</style><!-- Ends CSS styling -->
</head>
<body>
<p><strong>w3resource Tutorial</strong></p><!-- Paragraph element with strong (bold) text -->
<p class="w3r1"><!-- Paragraph element with class w3r1 -->
CSS, stands for Cascading Style Sheet is a computer language to describe presentation (for example width, height, color, background color, alignment etc.) of HTML and XML (and XML based languages like XHTML, SVG) web documents. In all the examples of our tutorials, we have used HTML for implementing CSS. <!-- Text content -->
</p><!-- Ends the paragraph element -->
<p class="w3r2"><!-- Paragraph element with class w3r2 -->
CSS, stands for Cascading Style Sheet is a computer language to describe presentation (for example width, height, color, background color, alignment etc.) of HTML and XML (and XML based languages like XHTML, SVG) web documents. In all the examples of our tutorials, we have used HTML for implementing CSS. <!-- Text content -->
</p><!-- Ends the paragraph element -->
<p class="w3r3"><!-- Paragraph element with class w3r3 -->
CSS, stands for Cascading Style Sheet is a computer language to describe presentation (for example width, height, color, background color, alignment etc.) of HTML and XML (and XML based languages like XHTML, SVG) web documents. In all the examples of our tutorials, we have used HTML for implementing CSS. <!-- Text content -->
</p><!-- Ends the paragraph element -->
<p class="w3r4"><!-- Paragraph element with class w3r4 -->
CSS, stands for Cascading Style Sheet is a computer language to describe presentation (for example width, height, color, background color, alignment etc.) of HTML and XML (and XML based languages like XHTML, SVG) web documents. In all the examples of our tutorials, we have used HTML for implementing CSS. <!-- Text content -->
</p><!-- Ends the paragraph element -->
</body>
</html><!-- Ends the HTML document -->
Explanation:
Live Demo:
See the Pen font-answer by w3resource (@w3resource) on CodePen.
See the solution in the browser
Supported browser
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