CSS Questions & Answers – Specifying Bullet Point Styles, CSS Image Alignment…

CSS Multiple Choice Questions & Answers (MCQs) focuses on “Specifying Bullet Point Styles, CSS Image Alignment, ID and Class”.

Q 1. Which of the following is not the value for an unordered list?
A. disc
B. numeric
C. circle
D. square

Show Answer Answer:-B. numeric
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;}

Q 2. Which of the following value sits to the left of the block of text?
A. left
B. outside
C. inside
D. right

Show Answer Answer:-B. outside
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.

Q 3. Which is not a box-level element?
A. <p>
B. <ul>
C. <li>
D. <b>

Show 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.

,

    ,
  • and

    . Inline elements follow in between surrounding text like , , .

Q 4. In which every block-level element appears on a new line?
A. floating positioning
B. relative positioning
C. absolute positioning
D. normal flow

Show Answer Answer:-D. normal flow
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.

Q 5. Which of the following will take the element out of normal flow?
A. fixed positioning
B. relative positioning
C. floating elements
D. absolute positioning

Show Answer Answer:-C. floating elements
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.

Q 6. Which value clear property can’t take?
A. left
B. right
C. center
D. none

Show Answer Answer:-C. center
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.

Q 7. Which of the property is not used for positioning columns next to each other?
A. border
B. width
C. margin
D. float

Show Answer Answer:-A. border
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.

Q 8. Which of the following is not the value for background-repeat property?
A. repeat-y
B. repeat-x
C. no-repeat
D. fixed

Show Answer Answer:-D. fixed
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.

Q 9. Which of the following will move the image up and down?
A. fixed
B. scroll
C. repeat-x
D. repeat-y

Show Answer Answer:-B. scroll
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.

Q 10. Which should be used to overlay text on image with high contrast?
A. screen
B. high contrast
C. low contrast
D. opaque

Show Answer Answer:-A. screen
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.

Q 11. ID selector name is preceded by __________
A. ‘.’
B. ‘%’
C. ‘#’
D. ‘@’

Show 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; }

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

You cannot copy content of this page