Text and typography Flashcards
What is the purpose of the @font-face rule in CSS?
It allows specifying and using custom fonts from a remote server or the user’s device.
Why are MIME types important when using web fonts?
They ensure the browser correctly interprets and loads font files.
How do you change the typeface of text in CSS?
Use the font-family property with a comma-separated list of specific and generic font families.
Why should you provide a generic font family in font-family?
It acts as a fallback in case preferred fonts are unavailable.
What property controls italic and oblique text styles?
The font-style property.
What values does font-style accept?
normal, italic, and oblique.
How do you control text boldness in CSS?
Use the font-weight property.
What numeric values does font-weight accept?
Ranges from 100 to 900, with 400 as normal and 700 as bold.
What property controls text size in CSS?
The font-size property.
What property controls the spacing between lines of text?
The line-height property.
What property adjusts the spacing between characters?
The letter-spacing property.
What property adjusts the spacing between words?
The word-spacing property.
What is the purpose of the font shorthand property?
It sets multiple font-related properties at once.
How do you change text capitalization using CSS?
Use the text-transform property.
What property adds underlines, overlines, or strikethroughs to text?
The text-decoration property.
What property controls text indentation?
The text-indent property.
What property controls how hidden text is displayed?
The text-overflow property.
What property controls how whitespace is handled in text?
The white-space property.
What property controls how words break when they overflow a line?
The word-break property.
What property controls the horizontal alignment of text?
The text-align property.
What property controls the text flow direction?
The writing-mode property.
What property controls the orientation of characters in vertical writing modes?
The text-orientation property.
How do you add a shadow effect to text?
Use the text-shadow property.
What are variable fonts?
Fonts that contain multiple variants of a typeface within a single file.
What do ::first-letter and ::first-line pseudo-elements target?
The first letter and first line of a text block.
What does the ::selection pseudo-element do?
It changes the appearance of selected text.