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 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 uses 1vw or 1vh, whichever is smaller?

A - px

B - vh

C - vw

D - vmin

Answer : D

Explanation

vmin − 1vw or 1vh, whichever is smaller.

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

A - background-attachment

B - background

C - background-repeat

D - background-position

Answer : B

Explanation

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

Q 5 - Which of the following property is used to set the color of a text?

A - color

B - direction

C - letter-spacing

D - word-spacing

Answer : A

Explanation

The color property is used to set the color of a text.

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 specifies whether a border should be solid, dashed line, double line, or one of the other possible values?

A - :border-color

B - :border-style

C - :border-width

D - :border-bottom-color

Answer : B

Explanation

The border-style specifies whether a border should be solid, dashed line, double line, or one of the other possible values.

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

A - :border-bottom-style

B - :border-top-style

C - :border-left-style

D - :border-right-style

Answer : B

Explanation

The border-top-style changes the style of top 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 distance between a marker and the text in the list?

A - marker-offset

B - list-style-position

C - list-style-image

D - list-style

Answer : A

Explanation

The marker-offset specifies the distance between a marker and the text in the list.

css_questions_answers.htm