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 selects all paragraph elements with a lang attribute?

A - p[lang]

B - p[lang="fr"]

C - p[lang~="fr"]

D - p[lang|="fr"]

Answer : A

Explanation

p[lang] − Selects all paragraph elements with a lang attribute.

Answer : D

Explanation

All of the above options are correct.

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 to set the text direction?

A - color

B - direction

C - letter-spacing

D - word-spacing

Answer : B

Explanation

The direction property is used to set the text direction.

Q 6 - Which of the following property is used to control the flow and formatting of text?

A - white-space

B - text-shadow

C - text-decoration

D - text-transform

Answer : A

Explanation

The white-space property is used to control the flow and formatting of text.

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 width of bottom border?

A - :border-bottom-width

B - :border-top-width

C - :border-left-width

D - :border-right-width

Answer : A

Explanation

The border-bottom-width changes the width of bottom 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 value of cursor shows it as crosshair or plus sign?

A - crosshair

B - default

C - pointer

D - move

Answer : A

Explanation

crosshair: A crosshair or plus sign.

css_questions_answers.htm
Advertisements