CSS MCQs – Introduction to CSS Fundamentals

11.) Which of the following selectors selects all elements of a specific type?

A) ID selector
B) Class selector
C) Universal selector
D) Descendant selector

Answer: Option C

Explanation: The universal selector ‘*’ selects all elements in the HTML document.

12.) What does the term ‘Cascading’ refer to in CSS?

A) Applying styles from top to bottom
B) Applying styles based on specificity
C) Applying styles from parent to child elements
D) Applying styles from child to parent elements

Answer: Option A

Explanation: ‘Cascading’ in CSS refers to the process of applying styles from top to bottom, where styles can be overridden or inherited.

13.) Which CSS property is used to set the width of an element?

A) size
B) width
C) length
D) dimension

Answer: Option B

Explanation: The width property is used to set the width of an element in CSS.

14.) Which CSS property is used to create space between the border and the content of an element?

A) margin
B) spacing
C) padding
D) border-spacing

Answer: Option C

Explanation: The padding property is used to create space between the border and the content of an element in CSS.

15.) Which CSS property is used to control the order of the elements in the document flow?

A) z-index
B) order
C) float
D) position

Answer: Option B

Explanation: The order property is used with Flexbox to control the order of the elements in the document flow.

16.) Which CSS property is used to create rounded corners?

A) border-radius
B) corner-radius
C) rounded-corners
D) border-style

Answer: Option A

Explanation: The border-radius property is used to create rounded corners for an element in CSS.

17.) Which CSS property is used to specify the type of cursor to be displayed when hovering over an element?

A) mouse
B) pointer
C) hover
D) cursor

Answer: Option D

Explanation: The cursor property is used to specify the type of cursor to be displayed when hovering over an element in CSS.

18.) Which CSS property is used to set the background image of an element?

A) background
B) background-image
C) image
D) background-style

Answer: Option B

Explanation: The background-image property is used to set the background image of an element in CSS.

19.) Which CSS property is used to align text within an element?

A) text-align
B) align
C) text-style
D) align-text

Answer: Option A

Explanation: The text-align property is used to align text within an element in CSS.

20.) Which CSS property is used to control the transparency of an element?

A) transparency
B) transparent
C) alpha
D) opacity

Answer: Option D

Explanation: The opacity property is used to control the transparency of an element in CSS.

Leave a Reply

Your email address will not be published. Required fields are marked *