Fonts and Typography Web Typography 1 — Questions and Answers
Question 1: Which CSS property is used to specify the font family for text on a webpage?
- font-family (Correct answer)
- font-style
- text-font
- font-name
Correct answer: font-family
The CSS `font-family` property specifies the font or list of fallback fonts to use for an element's text.
Question 2: What does the CSS `@font-face` rule allow web designers to do?
- Load custom fonts from a server (Correct answer)
- Change font color
- Animate text
- Set line spacing
Correct answer: Load custom fonts from a server
`@font-face` allows designers to specify custom fonts that are downloaded from a server and applied to text on a webpage.
Question 3: Which unit is generally preferred for font sizes in responsive web design?
- rem (Correct answer)
- px
- pt
- cm
Correct answer: rem
`rem` (root em) is preferred in responsive web design because it scales relative to the root element's font size, making layouts easier to scale.
Question 4: What is a web-safe font?
- A font pre-installed on most operating systems (Correct answer)
- A font optimized for HTTPS
- A font with no licensing fees
- A font that blocks malware
Correct answer: A font pre-installed on most operating systems
Web-safe fonts are fonts that are pre-installed on virtually all operating systems, ensuring consistent rendering without custom loading.
Question 5: Which file format is most widely supported for web fonts across modern browsers?
- WOFF2 (Correct answer)
- TTF
- OTF
- SVG
Correct answer: WOFF2
WOFF2 (Web Open Font Format 2) offers the best compression and is supported by all modern browsers, making it the preferred web font format.
Question 6: What does the CSS `font-display` property control?
- How a font is displayed while loading (Correct answer)
- The font's color
- The font's border style
- The font's shadow effect
Correct answer: How a font is displayed while loading
The `font-display` property controls how a font face is displayed based on whether and when it has been downloaded and is ready to use.
Which CSS property is used to specify the font family for text on a webpage?