CSS Questions & Answers – Specifying Bullet Point Styles, CSS Image Alignment, ID and Class

This set of CSS written test Questions & Answers focuses on “Specifying Bullet Point Styles, CSS Image Alignment, ID and Class”.

1. Which of the following is not the value for an unordered list?
a) disc
b) square
c) circle
d) numeric
View Answer

Answer: d
Explanation: For unordered list, we can use none, disc, square, circle. For ordered list, we can use decimals, decimal-leading-zero, lower-alpha, upper-roman, lower-roman.

 ol {list-style-type: lower roman;}

2. Which of the following value sits to the left of the block of text?
a) outside
b) left
c) inside
d) right
View Answer

Answer: a
Explanation: List are indented into the page by default and list-style-position property indicates whether the marker should appear on inside or outside box containing main points. This property can take two values outside and inside. The marker sits to the left of the block of text, this is the default behavior if this property is not used.
advertisement
advertisement

3. Which is not a box-level element?
a) <p>
b) <ul>
c) <li>
d) <b>
View Answer

Answer: d
Explanation: CSS treats each HTML element as if it is in its own box. This box will either be block-level Box or inline box. Block-level elements start on a new line e.g. <p>, <ul>, <li> and <h1>. Inline elements follow in between surrounding text like <img>, <i>, <b>.

4. In which every block-level element appears on a new line?
a) normal flow
b) relative positioning
c) absolute positioning
d) floating positioning
View Answer

Answer: a
Explanation: Every block-level element appears on a new line, which causes each item to appear lower down the page than the previous one. Even if we specify the width of the boxes and there is space for two elements to sit side by side, they will not appear next to each other.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

5. Which of the following will take the element out of normal flow?
a) fixed positioning
b) floating elements
c) relative positioning
d) absolute positioning
View Answer

Answer: b
Explanation: Floating an element allows us to take that element out of normal flow and position it too far left or right of a containing box. The floated element becomes block-level element around which other content can flow.

6. Which value clear property can’t take?
a) left
b) right
c) none
d) center
View Answer

Answer: d
Explanation: The clear property allows us to say that no element within the same containing element should touch left or right hand sides of a box. It can take the values left, right, both or none. When set to none elements can touch either side.
advertisement

7. Which of the property is not used for positioning columns next to each other?
a) float
b) width
c) margin
d) border
View Answer

Answer: d
Explanation: Many web pages used multiple columns in their design. The three CSS properties are used to position columns next to each other. Width, margin, and float. Width sets the width of the column, float positions columns next to each other, margin creates a gap between columns.

8. Which of the following is not the value for background-repeat property?
a) repeat-y
b) repeat-x
c) no-repeat
d) fixed
View Answer

Answer: d
Explanation: Background-repeat property can have four values i.e. repeat, repeat-x, repeat-y and no -repeat. The background image is repeated both horizontally and vertically by setting the value repeat, repeat-x repeats the image horizontally only.
advertisement

9. Which of the following will move the image up and down?
a) scroll
b) fixed
c) repeat-x
d) repeat-y
View Answer

Answer: a
Explanation: The background image moves up and down as the user scrolls up and down the page. The fixed value helps background image stays in the same position on the page.

10. Which should be used to overlay text on image with high contrast?
a) screen
b) high contrast
c) low contrast
d) opaque
View Answer

Answer: a
Explanation: To overlay text on an image with high contrast, we can place a semi-transparent background color or “screen” behind the text to improve legibility. The majority of photographs have quite high contrast, that means they are not ideal for use as background image.

11. ID selector name is preceded by __________
a) ‘.’
b) ‘%’
c) ‘#’
d) ‘@’
View Answer

Answer: c
Explanation: In CSS class selector name is preceded by a full stop (‘.’) and ID selector name is preceded by hash character (‘#’).

#intro {background-color: red; padding: 30px; }, .top {color: white; font-weight: bold; }

Sanfoundry Global Education & Learning Series – CSS.

To practice all written questions on CSS, 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.