CSS (Text, Borders, and Images) 2 — Questions and Answers
Question 1: Which CSS property controls the space between lines of text?
- line-height (Correct answer)
- letter-spacing
- word-spacing
- text-indent
Correct answer: line-height
line-height sets the vertical spacing between lines of text.
Question 2: What does 'text-transform: uppercase' do?
- Converts text to all capital letters (Correct answer)
- Bolds the text
- Capitalizes the first letter only
- Underlines the text
Correct answer: Converts text to all capital letters
text-transform: uppercase renders all characters as capitals.
Question 3: Which border style produces a series of dots?
- dotted (Correct answer)
- dashed
- groove
- double
Correct answer: dotted
The dotted value draws the border as a row of dots.
Question 4: Which property rounds the corners of a border?
- border-radius (Correct answer)
- border-style
- border-collapse
- outline-radius
Correct answer: border-radius
border-radius rounds the corners of an element's border box.
Question 5: How do you make a background image not repeat?
- background-repeat: no-repeat (Correct answer)
- background-repeat: none
- background-image: single
- background-tile: off
Correct answer: background-repeat: no-repeat
background-repeat: no-repeat displays the image only once.
Question 6: Which property sets the space between individual characters?
- letter-spacing (Correct answer)
- word-spacing
- line-height
- text-spacing
Correct answer: letter-spacing
letter-spacing adjusts the horizontal space between letters.
Question 7: What is the shorthand to set border width, style, and color at once?
- border: 2px solid red (Correct answer)
- border-all: 2px red solid
- border-set: solid 2px red
- borders: 2px red solid
Correct answer: border: 2px solid red
The border shorthand takes width, style, then color.
Which CSS property controls the space between lines of text?