CSS - MCQ Questions and Answers

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

« First 6 7 8 9 Last »
« Previous Page Next Page »

121. Which CSS property creates print-specific styles?

  • a) @media print
  • b) @print
  • c) media="print"
  • d) print-style
Answer: A - @media print { ... } targets printed documents.

122. Which CSS property hides elements when printing?

  • a) display: none
  • b) visibility: hidden
  • c) print-visibility: none
  • d) @print { display: none }
Answer: A - Combine with @media print to hide non-essential content.

123. Which CSS feature supports right-to-left (RTL) languages?

  • a) direction: rtl
  • b) writing-mode
  • c) text-orientation
  • d) All of the above
Answer: D - direction: rtl flips layout, while writing-mode handles vertical text.

124. Which CSS pseudo-element targets the first line of every paragraph?

  • a) ::first-line
  • b) p::first
  • c) ::paragraph-start
  • d) :first-line
Answer: A - Note the double colon syntax for pseudo-elements.

125. Which CSS selector targets visited links?

  • a) :visited
  • b) :link
  • c) a[visited]
  • d) :active
Answer: A - Privacy restrictions limit styleable properties for visited links.

126. Which CSS pseudo-class targets form elements with invalid values?

  • a) :invalid
  • b) :not-valid
  • c) :error
  • d) :failed
Answer: A - Works with required, pattern, and type validation.

127. Which CSS feature creates a "sticky" table header?

  • a) position: sticky
  • b) thead { fixed }
  • c) sticky-header: true
  • d) table { position: sticky }
Answer: A - th { position: sticky; top: 0 } keeps headers visible.

128. Which CSS property enables smooth scrolling anchor links?

  • a) scroll-behavior
  • b) smooth-scroll
  • c) scroll-transition
  • d) html { scroll: smooth }
Answer: A - scroll-behavior: smooth creates animated scrolling.

129. Which CSS feature creates a color gradient border?

  • a) border-image
  • b) border-gradient
  • c) gradient-border
  • d) border-color: linear-gradient()
Answer: A - border-image: linear-gradient(red, blue) 1 with border-width.

130. Which CSS property enables GPU acceleration?

  • a) transform: translateZ(0)
  • b) will-change: transform
  • c) Both a and b
  • d) gpu: accelerate
Answer: C - Both promote elements to their own compositor layer.

131. Which CSS property creates a drop cap effect?

  • a) ::first-letter
  • b) initial-letter
  • c) drop-cap
  • d) text-transform: capitalize
Answer: A - p::first-letter { font-size: 3em; float: left }.

132. Which CSS feature detects touchscreen devices?

  • a) @media (pointer: coarse)
  • b) @media touch
  • c) @media (hover: none)
  • d) Both a and c
Answer: D - Combines pointer accuracy and hover capability tests.

133. Which CSS property creates a masking effect?

  • a) mask-image
  • b) clip-path
  • c) Both a and b
  • d) filter: mask()
Answer: C - clip-path uses shapes, mask-image uses alpha channels.

134. Which CSS function creates conditional styles?

  • a) @supports
  • b) @media
  • c) @if (Sass)
  • d) All of the above
Answer: D - Each handles different conditions (browser support, viewport, preprocessor logic).

135. Which CSS property controls overscroll behavior?

  • a) overscroll-behavior
  • b) scroll-chaining
  • c) prevent-default
  • d) scroll-lock
Answer: A - overscroll-behavior: contain prevents scroll bleed.

136. Which CSS feature creates a morphing animation?

  • a) clip-path + transition
  • b) shape-outside
  • c) svg morphing
  • d) transform: morph()
Answer: A - Transition between clip-path shapes creates morph effects.

137. Which CSS property creates a glassmorphism effect?

  • a) backdrop-filter
  • b) filter: blur()
  • c) opacity
  • d) All of the above
Answer: D - Combine backdrop-filter: blur() with semi-transparency.

138. Which CSS feature improves font rendering on MacOS?

  • a) -webkit-font-smoothing
  • b) text-rendering
  • c) font-smooth
  • d) Both a and b
Answer: A - -webkit-font-smoothing: antialiased enhances thin text.

139. Which CSS property creates a reflection effect?

  • a) -webkit-box-reflect
  • b) reflection
  • c) mirror-effect
  • d) transform: reflect()
Answer: A - Non-standard but widely supported: -webkit-box-reflect: below.

140. Which CSS feature creates a dark/light mode toggle?

  • a) @media (prefers-color-scheme)
  • b) CSS Variables + JavaScript
  • c) Both a and b
  • d) color-mode: toggle
Answer: C - Media query detects OS preference, JS enables user override.
« First 6 7 8 9 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.