Quizz
The full text of this chapter, to read or revisit. To practise, do the exercises.
βΆ Do the exercisesExercise 1 β Proper Font Family Declaration
Which of the following is the correct way to specify Arial as the primary font, with sans-serif as a fallback?
font-family: Arial, sans-serif;font-family: "Arial"; font-family: "sans-serif";font-family: Arial + sans-serif;font-family: (Arial, sans-serif);Hint : Remember that multiple font families should be separated by commas, with the preferred font listed first and generic fallback fonts at the end.
Exercise 2 β Complete the Font Styling
Complete the CSS to make the heading large, bold, and use a serif font.
Hint : Think about the properties needed to control the size and weight of text, and the appropriate fallback for a serif font.
Exercise 3 β Match Text Properties with Their Effects
Match each CSS property with its visual effect:
text-align: center;text-decoration: underline;text-transform: uppercase;font-style: italic;Exercise 4 β Line Height Units
Which line-height value is most recommended for maintaining proper spacing across different font sizes?
line-height: 1.5;line-height: 24px;line-height: 150%;line-height: 1.5em;Hint : Consider which type of value will scale proportionally when font sizes change, rather than remaining fixed.
Exercise 5 β Complete the Link Styling
Complete the CSS to style links as uppercase with no underline and red color when hovered.
Hint : Consider which properties control the underlining of text and the case transformation of letters.
Exercise 6 β Match Elements with Their Purpose
Match each HTML element or CSS property with its correct purpose:
<br><hr>letter-spacingword-spacingExercise 7 β Font Weight Values
Which font-weight value represents a bolder weight than normal but lighter than bold?
font-weight: 600;font-weight: normal;font-weight: bolder;font-weight: 300;Hint : Remember that font-weight can use numeric values from 100 to 900, where 400 is normal and 700 is bold.
Exercise 8 β Complete the Paragraph Styling
Complete the CSS to create justified paragraph text with increased line spacing.
Hint : Use `text-align` to control the alignment and `line-height` to adjust the vertical spacing between lines of text.
Exercise 9 β Match Text Decoration Properties
Match each text-decoration property with its effect:
text-decoration-line: underline;text-decoration-style: wavy;text-decoration-color: red;text-decoration: line-through;Exercise 10 β Responsive Font Size
Which font-size unit is best for creating responsive text that scales with the viewport size?
font-size: 5vw;font-size: 20px;font-size: 1.5em;font-size: 150%;Hint : Consider which unit is specifically designed to scale in relation to the viewport (browser window) dimensions rather than parent elements or default sizes.
Exercise 11 β Complete the Title Styling
Complete the CSS to make the title appear in uppercase letters and centered alignment.
Hint : `text-transform: uppercase` turns all letters into capital letters, and `text-align: center` aligns the text to the center.
Exercise 12 β Match Font Style Properties
Match each CSS code snippet with its visual description:
font: italic bold 16px/1.5 Arial, sans-serif;font: small-caps 14px Georgia, serif;text-shadow: 2px 2px 4px #000000;font-stretch: condensed;Exercise 13 β Text Alignment Practice
Which CSS rule will center the text inside a heading element?
text-align: center;align-items: center;margin: auto;justify-content: center;Hint : `text-align: center;` is the correct way to horizontally center inline content like text.
Exercise 14 β Style a Horizontal Rule
Complete the CSS to create a custom horizontal line with a solid color and no default border.
Hint : `border: none` removes the default line style, and `background-color` gives your `<hr>` its new color.
Exercise 15 β Match Spacing Properties
Match each spacing property with its purpose:
line-heightletter-spacingword-spacingtext-indentExercise 16 β Web Safe Fonts
Which of the following font-family combinations is most likely to display consistently across different operating systems?
font-family: Arial, Helvetica, sans-serif;font-family: Futura, Avenir, sans-serif;font-family: "Codemon Sans", Arial, sans-serif;font-family: serif;Hint : Think about which font combinations include fonts that are widely installed across different operating systems (web-safe fonts).
Exercise 17 β Style a Title
Complete the CSS to make the title red and center-aligned.
Hint : `color` changes the text color, and `text-align` adjusts how the text is aligned inside its container.
Exercise 18 β Match CSS with Text Effects
Match each CSS rule with the effect it creates:
text-transform: uppercase;text-align: center;font-weight: bold;font-style: italic;Exercise 19 β Best Line Height Value
Which line-height value creates the most readable text for paragraphs?
line-height: 1.5;line-height: 1;line-height: 3;line-height: 0;Hint : A line-height value between 1.4 and 1.6 is generally considered ideal for paragraph text readability, providing enough space between lines without making them too far apart.
Exercise 20 β Text Alignment Properties
Complete the CSS to create a card with a centered heading and justified paragraph text.
Hint : Remember that text-align is the property that controls horizontal alignment of text within its container.
Exercise 21 β Match Font Size Units
Match each font size unit with its description:
pxemremvwExercise 22 β Proper Use of Line Breaks
Which is the most appropriate use of the <br> element?
Hint : Think about the semantic purpose of <br> - when is it appropriate to force a line break within a block of text?
Exercise 23 β Style Block Quotes
Complete the CSS to style a blockquote with italics, indentation, and a left border.
Hint : Consider which property controls italic text and which property adds a border only on the left side of an element.
Exercise 24 β Match Text Properties with Their Purpose
Match each CSS property with its purpose:
line-heighttext-decorationfont-weighttext-transformExercise 25 β Font Family Best Practice
Which of the following is the best practice when specifying font families in CSS?
Hint : It's best to provide a list of font options, starting with your preferred font and ending with a generic fallback like serif or sans-serif, to ensure text displays properly for all users.