CSS Online Quiz


Advertisements


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 all elements of a type?

A - The Type Selector

B - The Universal Selector

C - The Descendant Selector

D - The Class Selector

Answer : A

Explanation

The Type Selector selects all elements of a type.

Q 2 - Which of the following selector selects all paragraph elements whose lang attribute contains the word "fr"?

A - p[lang]

B - p[lang="fr"]

C - p[lang~="fr"]

D - p[lang|="fr"]

Answer : C

Explanation

p[lang~="fr"] − Selects all paragraph elements whose lang attribute contains the word "fr".

Answer : D

Explanation

All of the above options are correct.

Q 4 - Which of the following property is used to make a font italic or oblique?

A - font-family

B - font-style

C - font-variant

D - font-weight

Answer : B

Explanation

The font-style property is used to make a font italic or oblique.

Q 5 - Which of the following property is used to align the text of a document?

A - text-indent

B - text-align

C - text-decoration

D - text-transform

Answer : B

Explanation

The text-align property is used to align the text of a document.

Q 6 - Which of the following property is used to set the width of an image?

A - border

B - height

C - width

D - -moz-opacity

Answer : C

Explanation

The width property is used to set the width of an image.

Q 7 - Which of the following property of a table element specifies whether the border should be shown if a cell is empty?

A - :border-collapse

B - :border-spacing

C - :caption-side

D - :empty-cells

Answer : D

Explanation

The empty-cells specifies whether the border should be shown if a cell is empty.

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

A - :border-bottom-width

B - :border-top-width

C - :border-left-width

D - :border-right-width

Answer : C

Explanation

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

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

A - :margin

B - :margin-bottom

C - :margin-top

D - :margin-left

Answer : D

Explanation

The margin-left specifies the left 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