Knowledge check: Debugging

21. In a CSS selector such as 'div .alpha>p', what will be the element or class that will be read first by the CSS compiler?

  • div
  • the entire selector is read and interpreted
  • p
  • .alpha

22. What is the default behavior of CSS when it encounters an incomplete rule with missing values?

  • It will stop further compilation altogether without reporting the error
  • It will stop further compilation altogether after reporting the error
  • It will ignore the specific property-value pair and continue compilation
  • It will set default values for the property and continue compilation

23. A styling issue is occurring with an element on your web page. You can skip the missing delimiter for the last property but it is not a good practice.

  • True
  • False

24. Which of the following are ideal coding practices to reduce errors in CSS? Choose all that apply.

  • Overspecificity
  • Universal selectors
  • Shorthand properties

25. Modernizer, reset.css and normalize.css are types of:

  • CSS libraries for help in browser compatibility
  • CSS validators
  • CSS linters
  • CSS libraries for live previews

26. Which of the following types is the stylesheet created by the browser to render CSS?

  • User-agent stylesheet
  • Syntactically Awesome stylesheet
  • Author stylesheet
  • User stylesheet

Module quiz: Interactive CSS

27. Which of the following describes the CSS selector [href~="dog"] ?

  • Select all elements with the href attribute where the value starts with the word dog
  • Select all elements with the href attribute where the value contains the word dog
  • Select all elements with the href attribute where the value ends with the word dog

28. div + p is an example of which type of CSS selector?

  • General Sibling Selector
  • Adjacent Sibling Selector
  • Child Selector

Shuffle Q/A 3

29. Which of the following CSS selectors is suitable for changing an element's style based on the state of the element?

  • Pseudo-class Selector
  • Descendant Selector
  • Element Selector
  • Class Selector

30. True or false. The following CSS code will change the color of paragraph elements to red.

/*
p { color: red; }
*/

  • True
  • False

Leave a Reply