Introduction to CSS | Part 3 | Build Your Own Static Website | Cheat Sheet
1. Font Family
2. Font Size
3. Font Style
The CSS font-style property specifies the font style for a text.
You can use one of the below values of the font-style property,
.main-heading {
font-style: italic;
}
.paragraph {
font-style: normal;
}
Note:-
1. There shouldn't be any spelling mistakes in the values of the font-style property.
2. There shouldn't be any quotations around the value of the font-style property.
4. Font Weight
The CSS font-weight property specifies how thick or thin characters in text should be displayed.
.main-heading {
font-weight: bold;
}
.paragraph {
font-weight: 200;
}
You can use one of the below values of the font-weight property,
5. Text Decoration
The CSS text-decoration property specifies the decoration added to the text.
.main-heading {
text-decoration: underline;
}
.paragraph {
text-decoration: overline;
}
You can use one of the below values of the text-decoration property,
Note:-
1. There shouldn't be any spelling mistakes in the values of the text-decoration property.
2. There shouldn't be any quotations around the value of the text-decoration property.
3. Ensure that text-decoration and line-through are hyphenated.
Example:-
HTML Code:-
<!DOCTYPE html>
<html>
<head></head>
<body>
<h1 class="main-heading">Tourism</h1>
<p class="paragraph">Plan your trip wherever you want to go</p>
</body>
</html>
CSS Code:-
.main-heading {
font-family: "Roboto";
font-size: 36px;
font-style: italic;
font-weight: bold;
text-decoration: underline;
}
.paragraph {
font-family: "Roboto";
font-size: 28px;
font-style: normal;
font-weight: 200;
text-decoration: overline;
}
Output:-
Comments
Post a Comment