CSS MCQ Questions

Our website provides a collection of CSS (Cascading Style Sheets) MCQs to help learners practice and understand web design concepts. Questions cover topics like selectors, properties, layouts, colors, fonts, animations, and responsive design. Each question includes clear explanations to help users grasp key ideas quickly. Perfect for students, web developers, and job aspirants, this platform makes learning CSS easier and better prepares users for exams and interviews.

Q1. Which property is used to change the text color in CSS?

Correct Answer: B

The color property defines the text color in CSS.

Q2. Which CSS property controls the size of text?

Correct Answer: B

The font-size property is used to control text size.

Q3. Which of the following is the correct way to add an external CSS file?

Correct Answer: B

External CSS is linked using the tag.

Q4. Which CSS property is used to set background color?

Correct Answer: C

background-color is used to set the background color.

Q5. What is the default position value of an HTML element in CSS?

Correct Answer: C

By default, elements are positioned static.

Q6. Which CSS property is used to control the spacing between lines of text?

Correct Answer: B

line-height controls spacing between lines.

Q7. Which of the following units is relative in CSS?

Correct Answer: C

em is a relative unit, based on parent element font-size.

Q8. Which property makes text bold in CSS?

Correct Answer: C

font-weight controls text thickness (boldness).

Q9. Which property is used to create space inside an element’s border?

Correct Answer: B

Padding adds space inside an element, between content and border.

Q10. Which property is used to create space outside an element’s border?

Correct Answer: A

Margin adds space outside the element border.

Q11. Which CSS property is used to change the type of cursor?

Correct Answer: A

cursor property changes the mouse cursor style.

Q12. Which pseudo-class is used to style a link when hovered?

Correct Answer: B

:hover applies style when mouse hovers over the link.

Q13. Which CSS function is used to apply a gradient background?

Correct Answer: C

linear-gradient() and radial-gradient() functions apply gradient backgrounds.

Q14. Which CSS property makes text italic?

Correct Answer: B

font-style: italic makes text italic.

Q15. Which property controls the visibility of an element without removing space?

Correct Answer: C

visibility: hidden hides the element but keeps the space.

Q16. Which CSS property defines the transition effect duration?

Correct Answer: B

transition-duration sets how long a transition effect takes.

Q17. Which layout module is used to design responsive layouts in CSS?

Correct Answer: B

Flexbox is widely used for responsive and flexible layouts.

Q18. Which property in CSS is used to make a text all uppercase?

Correct Answer: A

text-transform: uppercase makes text capitalized.

Q19. Which CSS property adds shadow to text?

Correct Answer: C

text-shadow property adds shadow to text.

Q20. Which property is used to control how an element is displayed?

Correct Answer: A

display property controls element display type (block, inline, flex, etc.).

Latest Blogs