Top CSS Multiple Choice Questions & Answers

1. What does CSS stand for?

1. Cascading Style Sheets

2. Creative Style Sheets

3. Colorful Style Sheets

4. Computer Style Sheets

Right Ans -: 1


2. Which of the following is correct about CSS?

1. CSS is used to control the style of a web document in a simple and easy way.

2. CSS is the acronym for “Cascading Style Sheet”

3. You can write CSS once and then reuse same sheet in multiple HTML pages

4. All of the above

Right Ans -: 4


3. Which of the following is correct about CSS?

1. Style sheets allow content to be optimized for more than one type of device

2. CSS can store web applications locally with the help of an offline catche

3. Using CSS, we can view offline websites.The cache also ensures faster loading and better overall performance of the website

4. All of the above

Right Ans -: 4


4. Which of the following is a component of CSS style rule?

1. Selector

2. Property

3. Value

4. All of the above

Right Ans -: 4


5. Which of the following selector matches all elements of a type?

1. The Type Selector

2. The Universal Selector

3. The Descendant Selector

4. The Class Selector

Right Ans -: 1


6. Which of the following selector matches the name of any element type?

1. The Type Selector

2. The Universal Selector

3. The Descendant Selector

4. The Class Selector

Right Ans -: 2


7. Which of the following selector matches a particular element only when it lies inside a particular element?

1. The Type Selector

2. The Universal Selector

3. The Descendant Selector

4. The Class Selector

Right Ans -: 3


8. Which of the following selector matches a element based on its class attribute?

1. The Type Selector

2. The Universal Selector

3. The Descendant Selector

4. The Class Selector

Right Ans -: 4


9. Which of the following selector matches a element based on its id?

1. The Id Selector

2. The Universal Selector

3. The Descendant Selector

4. The Class Selector

Right Ans -: 1


10. Which of the following selector selects all paragraph elements with a lang attribute?

1. p[lang]

2. p[lang=”fr”]

3. p[lang~=”fr”]

4. p[lang|=”fr”]

Right Ans -: 1


11. Which of the following selector selects all paragraph elements whose lang attribute has a value of exactly “fr”?

1. p[lang]

2. p[lang=”fr”]

3. p[lang~=”fr”]

4. p[lang|=”fr”]

Right Ans -: 2


12. Which of the following is a way to associate styles with your HTML document?

1. Embedded CSS – The tags or rules defined in any external style sheet file.

2. Any rule defined in tags will override rules defined in any external style sheet file.

3. Any rule defined in external style sheet file takes lowest priority, and rules defined in this file will be applied only when above two rules are not applicable.

4. All of the above

Right Ans -: 3


13. Which of the following defines a measurement as a percentage relative to another value, typically an enclosing element?

1. %

2. cm

3. em

4. ex

Right Ans -: 1


14. Which of the following defines a measurement in centimeters?

1. %

2. cm

3. em

4. ex

Right Ans -: 2


15. Which of the following defines a measurement in inches?

1. in

2. m

m3. pc

4. pt

Right Ans -: 1


16. Which of the following defines a measurement in millimeters?

1. in

2. mm

3. pc

4. pt

Right Ans -: 2


17. Which of the following defines a measurement in picas?

1. in

2. mm

3. pc

4. pt

Right Ans -: 3


18. Which of the following defines a measurement in points?

1. in

2. mm

3. pc

4. pt

Right Ans -: 4


19. Which of the following defines a measurement in screen pixels?

1. px

2. vh

3. vw

4. vmin

Right Ans -: 1


20. Which of the following defines 1% of viewport height?

1. px2. vh

3. vw

4. vmin

Right Ans -: 2


21. Which of the following property is used to set the background color of an element?

1. background-color

2. background-image

3. background-repeat

4. background-position

Right Ans -: 1


22. Which of the following property is used to set the background image of an element?

1. background-color

2. background-image

3. background-repeat

4. background-position

Right Ans -: 2


23. Which of the following property is used to control the repetition of an image in the background?

1. background-color

2. background-image

3. background-repeat

4. background-position

Right Ans -: 3


24. Which of the following property is used to control the position of an image in the background?

1. background-color

2. background-image

3. background-repeat

4. background-position

Right Ans -: 4


25. Which of the following property is used to control the scrolling of an image in the background?

1. background-attachment

2. background

3. background-repeat

4. background-position

Right Ans -: 1


26. Which of the following property is used as a shorthand to specify a number of other background properties?

1. background-attachment

2. background

3. background-repeat

4. background-position

Right Ans -: 2


27. Which of the following property is used to change the face of a font?

1. font-family

2. font-style

3. font-variant

4. font-weight

Right Ans -: 1


28. Which of the following property is used to make a font italic or oblique?

1. font-family

2. font-style

3. font-variant

4. font-weight

Right Ans -: 2


29. Which of the following property is used to create a small-caps effect?

1. font-family

2. font-style

3. font-variant

4. font-weight

Right Ans -: 3


30. Which of the following property is used to increase or decrease how bold or light a font appears?

1. font-family

2. font-style

3. font-variant

4. font-weight

Right Ans -: 4


31. Which of the following property is used to increase or decrease the size of a font?

1. font-size

2. font

3. font-variant

4. font-weight

Right Ans -: 1


32. Which of the following property is used as shorthand to specify a number of other font properties?

1. font-size

2. font

3. font-variant

4. font-weight

Right Ans -: 2


33. Which of the following property is used to set the color of a text?

1. color

2. direction

3. letter-spacing

4. word-spacing

Right Ans -: 1


34. Which of the following property is used to set the text direction?

1. color

2. direction

3. letter-spacing

4. word-spacing

Right Ans -: 2


35. Which of the following property is used to add or subtract space between the letters that make up a word?

1. color

2. direction

3. letter-spacing

4. word-spacing

Right Ans -: 3


36. Which of the following property is used to add or subtract space between the words of a sentence?

1. color

2. direction

3. letter-spacing

4. word-spacing

Right Ans -: 4


37. Which of the following property is used to add or subtract space between the words of a sentence?

1. text-indent

2. text-align

3. text-decoration

4. text-transform

Right Ans -: 1


38. Which of the following property is used to set the width of an image border?

1. border

2. height

3. width

4. moz-opacity

Right Ans -: 1


39. Which of the following property is used to set the height of an image?

1. border

2. height

3. width

4. -moz-opacity

Right Ans -: 2


40. Which of the following property of a anchor element signifies unvisited hyperlinks?

1. link

2. visited

3. hover

4. active

Right Ans -: 1