Practice Exercise
Create an article layout with a readable font stack, responsive heading, comfortable line height, appropriate line length, and an ellipsis treatment for a single-line label.
Quiz — 10 MCQs
- Which property sets the font family? (A) font-family (B) font-color (C) text-width (D) line-size. Answer: A. Font family specifies the preferred typeface list.
- What does line-height control? (A) Line-box height (B) Element ID (C) Border color (D) Image format. Answer: A. It controls the height of line boxes.
- Why are font fallbacks useful? (A) To provide alternatives when fonts are unavailable (B) To delete text (C) To remove HTML (D) To change routes. Answer: A. Fallback fonts maintain readable typography.
- Which property controls text capitalization? (A) text-transform (B) text-decoration (C) font-display (D) word-spacing. Answer: A. It can transform text to uppercase or lowercase for display.
- Which property controls text alignment? (A) text-align (B) text-indent only (C) font-weight (D) overflow-wrap. Answer: A. It aligns inline content within a line box.
- What does font-display: swap generally do? (A) Shows fallback text while the web font loads (B) Replaces HTML with CSS (C) Disables all fonts (D) Creates a database. Answer: A. Swap allows text to render using a fallback font during loading.
- Which unit is commonly useful for limiting text line length? (A) ch (B) kg (C) dpi only (D) db. Answer: A. Ch is based on the width of the zero glyph.
- Which property can display an ellipsis for clipped text? (A) text-overflow (B) text-indent (C) font-weight (D) text-transform. Answer: A. text-overflow controls how clipped inline overflow is indicated.
- What does letter-spacing control? (A) Spacing between characters (B) Paragraph count (C) Border width (D) Grid columns. Answer: A. It adjusts spacing between characters.
- Why use clamp() for headings? (A) To set minimum, fluid preferred and maximum sizes (B) To disable font loading (C) To remove text (D) To force fixed positioning. Answer: A. Clamp creates bounded fluid typography.
Key Takeaways
- Use font stacks, sensible sizes and comfortable line heights.
- Learn wrapping and overflow behavior to prevent layout issues.
- Web fonts and fluid typography help create polished responsive interfaces.