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 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 defines 1% of viewport width?

A - px

B - vh

C - vw

D - vmin

Answer : C

Explanation

vw − 1% of viewport width.

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 increase or decrease the size of a font?

A - font-size

B - font

C - font-variant

D - font-weight

Answer : A

Explanation

The font-size property is used to increase or decrease the size of a font.

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

A - :link

B - :visited

C - :hover

D - :active

Answer : B

Explanation

The :visited signifies unvisited hyperlinks.

Q 7 - Which of the following property specifies the width of a border?

A - :border-color

B - :border-style

C - :border-width

D - :border-bottom-color

Answer : C

Explanation

The border-width specifies the width of a border.

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 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 serves as shorthand for the padding properties?

A - padding

B - padding-top

C - padding-left

D - padding-right

Answer : A

Explanation

The padding serves as shorthand for the preceding properties.


css_questions_answers.htm

Advertisements