CSS - MCQ Questions and Answers

Test your knowledge of CSS with these interactive multiple-choice questions.

« First 3 4 5 6 Last »
« Previous Page Next Page »

61. Which CSS feature allows reusable values throughout a stylesheet?

  • a) CSS Variables (Custom Properties)
  • b) SASS variables
  • c) CSS Constants
  • d) CSS Mixins
Answer: A - :root { --main-color: #06c; } declares variables usable with var(--main-color).

62. Which CSS property applies blur effects to elements?

  • a) filter: blur()
  • b) backdrop-filter
  • c) blur()
  • d) box-shadow
Answer: A - filter: blur(5px) creates Gaussian blur effects.

63. Which CSS property blends an element's colors with its background?

  • a) mix-blend-mode
  • b) background-blend-mode
  • c) blend-mode
  • d) opacity
Answer: A - mix-blend-mode: multiply blends element content with what's behind it.

64. Which CSS property blends background images?

  • a) background-blend-mode
  • b) mix-blend-mode
  • c) image-blend
  • d) blend-image
Answer: A - background-blend-mode: overlay blends multiple background layers.

65. Which CSS selector targets elements with a specific attribute?

  • a) [attribute]
  • b) :attribute()
  • c) attr()
  • d) getAttribute()
Answer: A - [data-id="123"] selects elements with matching attributes.

66. Which CSS selector targets the first child of an element?

  • a) :first-child
  • b) :first-of-type
  • c) :nth-child(1)
  • d) All of the above
Answer: D - All selectors match the first child in different contexts.

67. Which CSS selector targets every odd-numbered element?

  • a) :nth-child(odd)
  • b) :odd
  • c) :alternate
  • d) :every(2n+1)
Answer: A - :nth-child(odd) or 2n+1 selects odd items.

68. Which CSS selector targets elements that are being hovered?

  • a) :hover
  • b) :active
  • c) :focus
  • d) :mouseover
Answer: A - :hover applies styles when the mouse is over an element.

69. Which CSS selector targets checked radio buttons/checkboxes?

  • a) :checked
  • b) :selected
  • c) :active
  • d) :toggle
Answer: A - input[type="checkbox"]:checked matches toggled inputs.

70. Which CSS selector targets empty elements?

  • a) :empty
  • b) :blank
  • c) :void
  • d) :no-content
Answer: A - :empty selects elements with no children (including text nodes).

71. Which CSS selector targets the placeholder text of inputs?

  • a) ::placeholder
  • b) :placeholder
  • c) :input-text
  • d) :hint
Answer: A - ::placeholder styles the placeholder text (note double colon).

72. Which CSS selector targets the first line of a paragraph?

  • a) ::first-line
  • b) :first-line
  • c) p:first
  • d) line:first
Answer: A - ::first-line pseudo-element styles the first line of text.

73. Which CSS selector targets the first letter of an element?

  • a) ::first-letter
  • b) :first-letter
  • c) letter:first
  • d) :initial-letter
Answer: A - ::first-letter creates drop caps or styled initials.

74. Which CSS selector targets links that haven't been visited?

  • a) :link
  • b) :unvisited
  • c) a:new
  • d) :fresh
Answer: A - :link matches unvisited links (distinct from :visited).

75. Which CSS selector targets elements that don't match a condition?

  • a) :not()
  • b) :except()
  • c) :exclude()
  • d) :nope()
Answer: A - :not(.hidden) selects elements without the .hidden class.

76. Which CSS selector targets elements based on language?

  • a) :lang()
  • b) [language]
  • c) :has-lang()
  • d) :locale()
Answer: A - :lang(fr) matches elements with French language content.

77. Which CSS selector targets elements that are currently focused?

  • a) :focus
  • b) :active
  • c) :selected
  • d) :current
Answer: A - :focus matches elements receiving keyboard/pointer focus.

78. Which CSS selector targets invalid form inputs?

  • a) :invalid
  • b) :not-valid
  • c) :error
  • d) :failed
Answer: A - input:invalid matches inputs failing validation constraints.

79. Which CSS selector targets elements with no siblings?

  • a) :only-child
  • b) :lonely
  • c) :single
  • d) :no-siblings
Answer: A - :only-child matches elements without brothers/sisters.

80. Which CSS selector targets elements that are currently being clicked?

  • a) :active
  • b) :click
  • c) :pressed
  • d) :mousedown
Answer: A - :active matches elements during mouse/keyboard activation.
« First 3 4 5 6 Last »
« Previous Page Next Page »

Learn Computer Skills with PCBooks

Master computer skills with PCBooks! Explore interactive tutorials, MCQ tests, and online exams for programming, web development, and IT fundamentals. Perfect for beginners and advanced learners.

Online MCQ Tests for Programming

Practice programming MCQ questions and improve your coding skills with our online quizzes. Whether you're learning Python, Java, or C programming, PCBooks has you covered.

Free Web Development Tutorials

Learn HTML, CSS, and JavaScript with our free web development tutorials. Test your knowledge with interactive quizzes and online exams.