CSS Text Quiz

Quiz 2 16 questions

Prerequisites for the quiz

  1. CSS Foundation Unit
  2. CSS Text Unit

Are you ready?

16 questions to solve

Instructions
  1. This quiz goes to full-screen once you press the Start button.
  2. At the end of the quiz, you are able to review all the questions that you answered wrong and see their explanations.
Which property can be used to change the font size of a piece of text?
font-size is the property by which we can set the size of any given font. Check out more at Font Styling.
How to give 1px of spacing between the letters of some text?
In (A) there are no quotes around the value 1px and hence it is the correct choice.
However In (C) the problem is the quotation done around the property's value i.e "1px". Where quotes are not expected a CSS interpreter will fail to execute those rules.
What does font-weight do?
Refer to Font Styling.
How can you make the text in #intro italic?
Refer to Font Styling.
Convert the text "hello world!", in an element, to "Hello World!"
text-transform: capitalise capitalises all the first characters i.e converts them to uppercase. Refer to Font Styling for more info.
Which property is used to convert text to all uppercase characters?
(A) is the correct choice; text-transform deals with all-uppercase scenario as well. There are no such properties like text-casing and font-casing in CSS.
How to increase the spacing between lines in some text.
line-height serves to adjust the distance between adjacent lines.
font-weight can take any positive integer up to 900, i.e 1, 2, 3.....900. True or False? If false then give the correct description.
See section Thick or Thin in the Font Styling chapter.
Give a text shadow shifted 3px to the top, 4px to the right, with a blur of 2px and color red.
See CSS Text Shadows for more details on text-shadow and its parameters.
Which of the following properties can be used to underline text?
text-decoration: underline serves to underline text. Except for choice (B), all other choices are non-existent CSS properties.
For a given element, set its font as "Playfair Display" and fallback fonts as "Arial" and the generic sans-serif family, in this order.
In (A) the first value i.e "Playfair Display, Arial", is not recognised by the CSS interpreter. In (B) the value sans-serif is enquoted which is wrong. Hence (C) is the correct choice. For more details on font-family refer to Setting a Font.
Is the code p {font-family: Open Sans} valid, assuming that "Open Sans" is the name of a single font?
This code is invalid, because to set a font, with a name having multiple words as in "Open Sans", we have to enquote it i.e p {font-family: "Open Sans"} is the correct code.
How to center align text?
Modify the whitespacing of an element such that it appears the same in the browser as in the HTML, and also wraps.
white-spacing is not a CSS property, hence the correct answer directly turns out to be (A).
Check out CSS Text Whitespacing for understanding the different types of white spacing given using the white-space property.
Which value of white-space removes only wrapping from a given piece of text, and lets every other default spacing behavior continue?
Which one of the following values of white-space preserves new lines only, but removes any sequence of spaces?