This set of CSS Interview Questions and Answers for Experienced people focuses on “CSS and (X)HTML Elements Fundamentals”.
1. Which of the following elements are block and inline elements, respectively, that have no particular rendering?
a) div
b) span
c) box-model
d) both div and span
View Answer
Explanation: The div element and span element are block and inline elements, respectively, that have no particular rendering. You might call them generic tags. Because these tags don’t have any predefined meaning or rendering, they are very useful for arbitrary style duties.
2. The _____________ property specifies the background color of an element.
a) background-color
b) border
c) color
d) display
View Answer
Explanation: Example:
body { background-image: url("img_tree.png"); background-repeat: no-repeat; }
3. The ___________ property specifies if/how an element is displayed.
a) background-color
b) border
c) color
d) display
View Answer
Explanation: Example:
h1.hidden { display: none; }
4. The _____________ property allows us to include the padding and border in an element’s total width and height.
a) margin
b) box-sizing
c) padding
d) none of the mentioned
View Answer
Explanation: Example:
.div1 { box-sizing: border-box; }
5. ____________ property sets the coordinates of the clipping shape that exposes or hides the content of absolutely positioned elements
a) clammper
b) clip
c) clear
d) none of the mentioned
View Answer
Explanation:
clip: rect(coordinates) | auto | inherit
6. _____________ property defines the space between cells in a table.
a) border
b) border-spacing
c) border-style
d) none of the mentioned
View Answer
Explanation:
border-spacing: non-negative length(s) | inherit
7. ____________ property defines whether table cell borders are connected or separate.
a) border-color
b) border
c) border-style
d) none of the mentioned
View Answer
Explanation: border-collapse roperty defines whether table cell borders are connected or separate.
8. ________________ property sets the background image to scroll or not to scroll with its associated element’s content
a) background
b) background-position
c) background-attachment
d) none of the mentioned
View Answer
Explanation: Example:
background-attachment: scroll | fixed | inherit
9. ____________ property associates a background image with an element.
a) image
b) background-image
c) float
d) none of the mentioned
View Answer
Explanation: Example:
background-image: url(image-file) | none | inherit
10. ______________ property defines whether table cell borders are connected or separate.
a) pre
b) border-color
c) border-collapse
d) table
View Answer
Explanation: Example:
border-collapse: collapse | separate | inherit
Sanfoundry Global Education & Learning Series – CSS.
To practice all areas of CSS for Interviews, 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]
- Practice HTML MCQ
- Practice MCA MCQs
- Check Computer Science Books
- Practice Computer Science MCQs
- Check CSS Books