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 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 defines a measurement as a percentage relative to another value, typically an enclosing element?

A - %

B - cm

C - em

D - ex

Answer : A

Explanation

% − Defines a measurement as a percentage relative to another value, typically an enclosing element.

Answer : D

Explanation

All of the above options are correct.

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 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 set the opacity of an image?

A - border

B - height

C - width

D - -moz-opacity

Answer : D

Explanation

The -moz-opacity property is used to set the opacity of an image.

Q 7 - Which of the following property of a table element allows browsers to speed up layout of a table by using the first width properties it comes across for the rest of a column rather than having to load the whole table before rendering it?

A - :table-layout

B - :border-spacing

C - :caption-side

D - :empty-cells

Answer : A

Explanation

The table-layout allows browsers to speed up layout of a table by using the first width properties it comes across for the rest of a column rather than having to load the whole table before rendering it.

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

A - :border-bottom-style

B - :border-top-style

C - :border-left-style

D - :border-right-style

Answer : C

Explanation

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

Q 9 - Which of the following property specifies an image for the marker rather than a bullet point or number?

A - list-style-type

B - list-style-position

C - list-style-image

D - list-style

Answer : C

Explanation

The list-style-image specifies an image for the marker rather than a bullet point or number.

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