CSS Questions & Answers – CSS1 and CSS 2.1 Properties

This set of CSS test focuses on “CSS1 and CSS 2.1 Properties”.

1. Which of the following property sets in a shorthand form any or all background properties?
a) font
b) background
c) background-color
d) background-position
View Answer

Answer: b
Explanation: Syntax:

background: background-color background-image background-repeat background-attachment background- position;

2. Which of the following property defines whether table cell borders are connected or separate?
a) border-style
b) border-collapse
c) border-color
d) border-bottom-width
View Answer

Answer: b
Explanation:

Syntax: border-collapse: collapse | separate | inherit

3. Which of the following property defines the style for the right border of an element?
a) border-left
b) border-right
c) border-right-style
d) border-style
View Answer

Answer: c
Explanation:

advertisement
advertisement
Syntax:border-right-style: dashed | dotted | double | groove | hidden | inset | inherit | none | outset | ridge | solid

4. Which of the following property defines the visual style of up to four different sides of a border?
a) border-width
b) border-top
c) border
d) border-style
View Answer

Answer: d
Explanation:

Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!
Syntax: border-style: style [ style style style ]

5. Which of the following property sets the coordinates of the clipping shape that exposes or hides the content of absolutely positioned elements?
a) clip
b) clamp
c) clip-wekit
d) clamp-webkit
View Answer

Answer: b
Explanation:

advertisement
Syntax: clip: rect(coordinates) | auto | inherit

6. Which of the following property generates content in a document and is used with the :before and :after pseudo-elements?
a) text
b) content
c) contents
d) none of the mentioned
View Answer

Answer: c
Explanation:

advertisement
Syntax: content: normal | none | string

7. Which of the following property controls CSS counter values?
a) counter
b) counter-increment
c) counter-decrement
d) none of the mentioned
View Answer

Answer: b
Explanation:

Syntax: counter-increment: counter-name1 [integer] ... counter-nameN [integer] | none | inherit

8. Which of the following property determines how the cursor displays when passed over the affected element?
a) mouse
b) cursor
c) click
d) focus
View Answer

Answer: d
Explanation:

Syntax: cursor: url(address of cursor file)

9. Which of the following property is used to control the text direction, much like the dir attribute for (X)HTML tags?
a) left
b) right
c) direction
d) direct
View Answer

Answer: c
Explanation:

Syntax: direction: ltr | rtl | inherit

10. Which of the following property specifies an element’s display type and can override an element’s defined presentation?
a) content
b) display
c) visibility
d) none of the mentioned
View Answer

Answer: d
Explanation:

Syntax: display: inline | block | list-item

Sanfoundry Global Education & Learning Series – CSS.

To practice all areas of CSS for tests, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.