CSS Online Quiz


Following quiz provides Multiple Choice Questions (MCQs) related to CSS. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.

Questions and Answers

Q 1 - Which of the following selector matches a element based on its class attribute?

A - The Type Selector

B - The Universal Selector

C - The Descendant Selector

D - The Class Selector

Answer : D

Explanation

The Class Selector matches a element based on its class attribute.

Q 2 - Which of the following defines a relative measurement for the height of a font in em spaces?

A - %

B - cm

C - em

D - ex

Answer : C

Explanation

em − A relative measurement for the height of a font in em spaces. Because an em unit is equivalent to the size of a given font, if you assign a font to 12pt, each "em" unit would be 12pt; thus, 2em would be 24pt.

Q 3 - Which of the following defines a measurement in millimeters?

A - in

B - mm

C - pc

D - pt

Answer : B

Explanation

mm − Defines a measurement in millimeters.

Q 4 - Which of the following property is used to set the background color of an element?

A - background-color

B - background-image

C - background-repeat

D - background-position

Answer : A

Explanation

The background-color property is used to set the background color of an element.

Q 5 - Which of the following property is used to add or subtract space between the words of a sentence?

A - text-indent

B - text-align

C - text-decoration

D - text-transform

Answer : A

Explanation

The text-indent property is used to indent the text of a paragraph.

Q 6 - Which of the following property of a anchor element signifies visited hyperlinks?

A - :link

B - :visited

C - :hover

D - :active

Answer : B

Explanation

The :visited signifies unvisited hyperlinks.

Q 7 - Which of the following property of a table element controls the placement of the table caption?

A - :border-collapse

B - :border-spacing

C - :caption-side

D - :empty-cells

Answer : C

Explanation

The caption-side captions are presented in the element. By default, these are rendered above the table in the document. You use the caption-side property to control the placement of the table caption.

Q 8 - Which of the following property changes the color of left border?

A - :border-top-color

B - :border-left-color

C - :border-right-color

D - :border-bottom-color

Answer : B

Explanation

The border-left-color changes the color of left border.

Q 9 - Which of the following property specifies the right margin of an element?

A - :margin-right

B - :margin-bottom

C - :margin-top

D - :margin-left

Answer : A

Explanation

The margin-right specifies the right margin of an element.

Q 10 - Which of the following property specifies the bottom padding of an element?

A - padding-bottom

B - padding-top

C - padding-left

D - padding-right

Answer : A

Explanation

The padding-bottom specifies the bottom padding of an element.

css_questions_answers.htm
Advertisements