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 a particular element only when it lies inside a particular element?

A - The Type Selector

B - The Universal Selector

C - The Descendant Selector

D - The Class Selector

Answer : C

Explanation

The Descendant Selector matches a particular element only when it lies inside a particular element.

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.

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

A - px

B - vh

C - vw

D - vmin

Answer : A

Explanation

px − Defines a measurement in screen pixels.

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 align the text of a document?

A - text-indent

B - text-align

C - text-decoration

D - text-transform

Answer : B

Explanation

The text-align property is used to align the text of a document.

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 anchor element signifies an element on which the user is currently clicking?

A - :link

B - :visited

C - :hover

D - :active

Answer : D

Explanation

The :active signifies an element on which the user is currently clicking.

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 a shorthand property for setting the margin properties in one declaration?

A - :margin

B - :margin-bottom

C - :margin-top

D - :margin-left

Answer : A

Explanation

The margin specifies a shorthand property for setting the margin properties in one declaration.

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