CSS Properties: How to specify all the font properties in one declaration?
Solution:
HTML Code:
Explanation:
- This HTML document demonstrates how to specify all font properties in one declaration using CSS.
- Comments are added to both HTML and CSS to explain each section of the code.
- In the CSS <style> block, multiple CSS classes are defined, each with the font property set to specify font size, font family, and font style in a single declaration.
- Each paragraph element (<p>) in the HTML is assigned one of these CSS classes, resulting in different font styles being applied to each paragraph.
Live Demo:
See the solution in the browser
Supported browser
![]() |
![]() |
![]() |
![]() |
![]() |
Yes | Yes | Yes | Yes | No |
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.