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 a element based on its id?

A - The Id Selector

B - The Universal Selector

C - The Descendant Selector

D - The Class Selector

Answer : A

Explanation

The Id Selector matches a element based on its id attribute.

Q 2 - Which of the following selector selects all paragraph elements whose lang attribute contains values that are exactly "fr", or begin with "fr-"?

A - p[lang]

B - p[lang="fr"]

C - p[lang~="fr"]

D - p[lang|="fr"]

Answer : D

Explanation

p[lang|="fr"] − Selects all paragraph elements whose lang attribute contains values that are exactly "fr", or begin with "fr-".

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 control the scrolling of an image in the background?

A - background-attachment

B - background

C - background-repeat

D - background-position

Answer : A

Explanation

The background-attachment property is used to control the scrolling of an image in the background.

Q 5 - Which of the following property is used as shorthand to specify a number of other font properties?

A - font-size

B - font

C - font-variant

D - font-weight

Answer : B

Explanation

The font property is used as shorthand to specify a number of other font properties.

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 specifies whether the browser should control the appearance of the adjacent borders that touch each other or whether each cell should maintain its style?

A - :border-collapse

B - :border-spacing

C - :caption-side

D - :empty-cells

Answer : A

Explanation

The border-collapse specifies whether the browser should control the appearance of the adjacent borders that touch each other or whether each cell should maintain its style.

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 bottom margin of an element?

A - :margin

B - :margin-bottom

C - :margin-top

D - :margin-left

Answer : B

Explanation

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

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

A - padding-bottom

B - padding-top

C - padding-left

D - padding-right

Answer : B

Explanation

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


css_questions_answers.htm

Advertisements
E-Books Store