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.

Q 2 - Which of the following is a way to associate styles with your HTML document?

A - External CSS - The Element

B - Imported CSS - @import Rule

C - Both of the above.

D - None of the above.

Answer : C

Explanation

Both of the above.

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

A - in

B - mm

C - pc

D - pt

Answer : D

Explanation

pt − Defines a measurement in points. A point is defined as 1/72nd of an inch.

Q 4 - Which of the following property is used to control the repetition of an image in the background?

A - background-color

B - background-image

C - background-repeat

D - background-position

Answer : C

Explanation

The background-repeat property is used to control the repetition of an image in the background.

Q 5 - Which of the following property is used to add or subtract space between the letters that make up a word?

A - color

B - direction

C - letter-spacing

D - word-spacing

Answer : C

Explanation

The letter-spacing property is used to add or subtract space between the letters that make up a word.

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

A - :link

B - :visited

C - :hover

D - :active

Answer : A

Explanation

The :link 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 width of top border?

A - :border-bottom-width

B - :border-top-width

C - :border-left-width

D - :border-right-width

Answer : B

Explanation

The border-top-width changes the width of top 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 left padding of an element?

A - padding-bottom

B - padding-top

C - padding-left

D - padding-right

Answer : C

Explanation

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

css_questions_answers.htm
Advertisements