CSS - MCQ Questions and Answers

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

« First 1 2 3 4 Last »
« Previous Page Next Page »

1. Which CSS property controls the text size?

  • a) font-size
  • b) text-size
  • c) size
  • d) text-style
Answer: A - font-size sets the size of the font (e.g., 16px, 1rem).

2. Which CSS property changes the font family?

  • a) font-family
  • b) text-family
  • c) font-type
  • d) family
Answer: A - font-family specifies prioritized font names (e.g., Arial, sans-serif).

3. Which CSS property makes text bold?

  • a) font-weight
  • b) text-bold
  • c) bold
  • d) font-style
Answer: A - font-weight: bold or numeric values like 700 create bold text.

4. Which CSS property adds space between letters?

  • a) letter-spacing
  • b) word-spacing
  • c) text-spacing
  • d) spacing
Answer: A - letter-spacing: 2px increases space between characters.

5. Which CSS property aligns text horizontally?

  • a) text-align
  • b) align-text
  • c) horizontal-align
  • d) justify
Answer: A - text-align: center|left|right|justify controls horizontal alignment.

6. Which CSS property underlines text?

  • a) text-decoration
  • b) underline
  • c) text-underline
  • d) font-decoration
Answer: A - text-decoration: underline adds an underline.

7. Which CSS property transforms text to uppercase?

  • a) text-transform
  • b) text-case
  • c) uppercase
  • d) font-transform
Answer: A - text-transform: uppercase converts text to all caps.

8. Which CSS property sets the line height?

  • a) line-height
  • b) text-height
  • c) height
  • d) spacing
Answer: A - line-height: 1.5 defines space between lines.

9. Which CSS property indents the first line of a paragraph?

  • a) text-indent
  • b) indent
  • c) paragraph-indent
  • d) margin-left
Answer: A - text-indent: 20px indents the first line.

10. Which CSS property adds shadow to text?

  • a) text-shadow
  • b) shadow
  • c) font-shadow
  • d) box-shadow
Answer: A - text-shadow: 2px 2px 4px #000 creates text shadows.

11. Which CSS property changes the cursor type?

  • a) cursor
  • b) pointer
  • c) mouse-cursor
  • d) hover
Answer: A - cursor: pointer|wait|crosshair changes the mouse cursor.

12. Which CSS property hides an element but keeps its space?

  • a) visibility: hidden
  • b) display: none
  • c) opacity: 0
  • d) hidden: true
Answer: A - visibility: hidden hides content while preserving layout space.

13. Which CSS property creates rounded corners?

  • a) border-radius
  • b) corner-radius
  • c) rounded
  • d) edge-radius
Answer: A - border-radius: 10px rounds element corners.

14. Which CSS property adds space outside an element?

  • a) margin
  • b) padding
  • c) spacing
  • d) outer-spacing
Answer: A - margin: 20px adds space outside the border.

15. Which CSS property adds space inside an element?

  • a) padding
  • b) margin
  • c) inner-spacing
  • d) spacing
Answer: A - padding: 10px adds space inside the border.

16. Which CSS property sets the background color?

  • a) background-color
  • b) bgcolor
  • c) color-background
  • d) background
Answer: A - background-color: #fff sets the element's background color.

17. Which CSS property adds a background image?

  • a) background-image
  • b) image
  • c) bg-image
  • d) background
Answer: A - background-image: url('image.jpg') sets a background image.

18. Which CSS property repeats a background image?

  • a) background-repeat
  • b) repeat
  • c) image-repeat
  • d) background-tiling
Answer: A - background-repeat: repeat|no-repeat|repeat-x|repeat-y controls tiling.

19. Which CSS property positions a background image?

  • a) background-position
  • b) image-position
  • c) position
  • d) background-location
Answer: A - background-position: center top aligns the image.

20. Which CSS property sets the border style?

  • a) border-style
  • b) border-type
  • c) style
  • d) outline
Answer: A - border-style: solid|dashed|dotted defines the border appearance.
« First 1 2 3 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.