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 selects all paragraph elements whose lang attribute has a value of exactly "fr"?

A - p[lang]

B - p[lang="fr"]

C - p[lang~="fr"]

D - p[lang|="fr"]

Answer : B

Explanation

p[lang="fr"] − Selects all paragraph elements whose lang attribute has a value of exactly "fr".

Q 2 - Which of the following defines a relative measurement for the height of a font in em spaces?

A - %

B - cm

C - em

D - ex

Answer : C

Explanation

em − A relative measurement for the height of a font in em spaces. Because an em unit is equivalent to the size of a given font, if you assign a font to 12pt, each "em" unit would be 12pt; thus, 2em would be 24pt.

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

A - background-color

B - background-image

C - background-repeat

D - background-position

Answer : D

Explanation

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

Q 5 - Which of the following property is used to add or subtract space between the words of a sentence?

A - text-indent

B - text-align

C - text-decoration

D - text-transform

Answer : A

Explanation

The text-indent property is used to indent the text of a paragraph.

Q 6 - Which of the following property is used to set the text shadow around a text?

A - white-space

B - text-shadow

C - text-decoration

D - text-transform

Answer : B

Explanation

The text-shadow property is used to set the text shadow around a text.

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 color of top border?

A - :border-top-color

B - :border-left-color

C - :border-right-color

D - :border-bottom-color

Answer : A

Explanation

The border-top-color changes the color of top border.

Q 9 - Which of the following property allows you to control the shape or appearance of the marker of a list?

A - list-style-type

B - list-style-position

C - list-style-image

D - list-style

Answer : A

Explanation

The list-style-type allows you to control the shape or appearance of the marker.

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