CSS MCQ Set 1
1. Which of the following tag is used to linked information should be placed inside?
a) <head> b) <html> c) <div> d) <body>
Answer
Answer: a [Reason:] None.
2. Which of the following tag can be used to embed a Document-wide styles in a document’s head element?
a) <head> b) <style> c) <script> d) <html>
Answer
Answer: b [Reason:]
Document-wide styles can be embedded in a document’s head element using the <style>tag.
3. The ________________ directive allows style sheets to be grouped and joined together, though some might wonder what the value of this function is given what linked styles provide.
a) <head> b) <style> c) <script> d) @import
Answer
Answer: d [Reason:]
Within embedded <style> blocks, properties can be imported from an external file and expanded in place, similar to a macro. Importing can be used to include multiple style sheets. An imported style is defined within a <style> tag using @import followed optionally by a type value and a URL for the style sheet.
4. Which of the following measurement defines a measurement relative to a font’s x-height?
a) ex
b) em
c) pt
d) px
Answer
Answer: a [Reason:] Defines a measurement relative to the height of a font in em spaces. Because an em unit is equivalent to the size of a given font, if you assign a font to 12pt, each em unit would be 12pt, thus 2em would be 24pt.
5. Which of the following measurement defines a measurement as a percentage?
a) %
b) cm
c) em
d) in
Answer
Answer: a [Reason:] Defines a measurement as a percentage. Percentages are denoted by a number followed by the % symbol and are always relative to another value such as length. Quite often they are used to specify some value relative to an inherited value from a parent element.
6. Which of the following property sets the font size of text?
a) text-size
b) font-size
c) size
d) text
Answer
Answer: b [Reason:] Syntax:
font-size: length | percentage | larger | smaller | xx-small | x-small | small | medium | large | x-large | xx-larger | inherit
7. Which of the following property sets a variation of the specified or default font family?
a) height
b) font-weight
c) default
d) font-variant
Answer
Answer: d [Reason:] Syntax:
font-variant: normal | small-caps | inherit
The small-caps value sets text in smaller-size all capitals. The normal value would be used to override any inherited font-variant value.
8. Which of the following property defines labels for a list of items?
a) list-style-type
b) list-style-image
c) list-style
d) none of the above
Answer
Answer: a [Reason:] Syntax:
list-style-type: disc | circle | square | decimal | decimal-leading-zero
9. Which of the following property assigns a graphic image to a list item?
a) list-style-type
b) list-style-image
c) list-style
d) none of the above
Answer
Answer: b [Reason:] Syntax:
list-style-image: url(url of image) | none
10. Which of the following property sets the amount of spacing between letters?
a) space
b) line-height
c) letter-spacing
d) none of the mentioned
Answer
Answer: c [Reason:] Syntax:
letter-spacing: length | normal | inherit
Length values can be set in various units (negative values are permitted) or to the default value normal.
CSS MCQ Set 2
1. Which of the following element is used within the table element to define a caption?
a) <tablecaption> b) <caption> c) <table-cap> d) <table-caption>
Answer
Answer: b [Reason:] None.
2. Which of the following property is used to specify table borders in CSS?
a) table
b) border
c) table:border
d) none of the mentioned
Answer
Answer: b [Reason:]
Example: table{border: 7px solid black;}
3. Which of the following property sets whether the table borders are collapsed into a single border or separated:?
a) border
b) border-collapse
c) collapse
d) table-border
Answer
Answer: b [Reason:]
Example: table{ border-collapse: collapse;}
4. Which of the following property is used to change the width of table?
a) width
b) table
c) table-width
d) resize
Answer
Answer: a [Reason:]
Example: table{width: 23px;}
5. Which of the following property sets the vertical alignment?
a) align
b) vertical
c) vertical-align
d) vertical-alignment
Answer
Answer: b [Reason:]
Example: table{vertical-align: top;}
6. Which of the following property is used to control the space between the border and content in a table?
a) border
b) margin
c) padding
d) resize
Answer
Answer: c [Reason:]
Example: table{border: 4px solid black;}
7. Which of the following property is used to change the background in a table?
a) table-background
b) background
c) color
d) none of the mentioned
Answer
Answer: b [Reason:] None.
8. Which of the following property is used to change the height of a table?
a) height
b) table-height
c) resize
d) position-y
Answer
Answer: a [Reason:]
Example: table{height: 45%;}
9. Which of the following property is used to align the text in a table?
a) align
b) text
c) text-align
d) none of the mentioned
Answer
Answer: c [Reason:]
Example: table{text-align: left;}
10. Which of the following property is used to set order in a table?
a) border
b) padding
c) dotted
d) text
Answer
Answer: a [Reason:]
Example: table{border: 1px solid #000;}
CSS MCQ Set 3
1. Which of the following property sets the size of the font?
a) font-size
b) font-variant
c) font-style
d) font-weight
Answer
Answer: a [Reason:] Self-explainatory.
2. Which of the following Property controls the display of small caps?
a) font-size
b) font-variant
c) font-style
d) font-weight
Answer
Answer: b [Reason:] Self-explainatory.
3. Which of the following font-weight property make the text lighter in relation to its parent?
a) unfocus
b) normal
c) lighter
d) normal
Answer
Answer: c [Reason:] Self-explainatory.
4. Which of the following property converts text to initial capitals, all uppercase, or all lowercase?
a) text-transform
b) text
c) text-decoration
d) text-uppercase
Answer
Answer: a [Reason:] Self-explainatory.
5. Which of the following font-variant property render text using the same letter case as in the underlying code?
a) bold
b) small-caps
c) normal
d) none of the mentioned
Answer
Answer: c [Reason:] Self-explainatory.
6. Which of the following property sets the alignment of the last line of a text block?
a) overflow-wrap
b) text-align-last
c) text-transform
d) text-indent
Answer
Answer: b [Reason:] Self-explainatory.
7. Which of the following property controls how spaces and word wrapping are handled?
a) spacing
b) text-space
c) white-space
d) word-spacing
Answer
Answer: c [Reason:] Self-explainatory.
8. Which of the following property specifies what line decorations, if any, are added to the text?
a) text-decoration-line
b) text-line-decoration
c) text-decoration-style
d) text-style-decoration
Answer
Answer: a [Reason:] Self-explainatory.
9. Which of the following property applies one or more shadows to text?
a) text-shadow
b) shadowed
c) shadow
d) word-shadow
Answer
Answer: a [Reason:] Self-explainatory.
10. Which of the following property allows long text, such as a URL, to be broken if it would otherwise over?ow.
a) text-transform
b) word-wrap
c) text-overflow
d) text-indent
Answer
Answer: b [Reason:] Self-explainatory.
CSS MCQ Set 4
1. Which of the following media feature describes the number of entries in the color lookup table of the output device
a) color
b) color-index
c) color-value
d)
Answer
Answer: b [Reason:] The ‘color-index’ media feature describes the number of entries in the color lookup table of the output device. If the device does not use a color lookup table, the value is zero
2. Which of the following Viewport Property sets the initial scaling factor?
a) scale
b) initial-scale
c) minimum-scale
d) user-scale
Answer
Answer: b [Reason:] Self-explainatory.
3. Which of the following Viewport Property determines whether the display can be zoomed in
and out?
a) scale
b) set-scale
c) adjust-scale
d) user-scalable
Answer
Answer: d [Reason:] Self-explainatory.
4. Which of the following @viewport Property sets the viewport height in the same way as width?
a) height
b) width
c) viewpor-width
d) none of the mentioned
Answer
Answer: a [Reason:] Self-explainatory.
5. Which of the following @viewport Property locks the document in the specified orientation, portrait or landscape?
a) orientation
b) resolution
c) landscape
d) portrait
Answer
Answer: a [Reason:] Self-explainatory.
6. Which of the following Media Query describe the ratio of the device width to the device height of the media?
a) device-aspect
b) device-aspect-ratio
c) device-aspect-query
d) none of the mentioned
Answer
Answer: c [Reason:] Self-explainatory.
7. Which of the following Media Query determines if output is grid, like a simple terminal or phone, or bitmap, like a standard monitor or printer?
a) monochrome
b) grid
c) resolution
d) device-height
Answer
Answer: b [Reason:] Self-explainatory.
8. Which of the following Media Query describes the scanning method of a TV?
a) orientation
b) scan
c) resolution
d) none of the mentioned
Answer
Answer: b [Reason:] Self-explainatory.
9. Which of the following Media Query determines if output is monochrome and how many bits are used for gray display?
a) gray
b) chrome
c) monochrome
d) none of the mentioned
Answer
Answer: c [Reason:] Self-explainatory.
10. A media query consists of a media type and zero or more expressions that check for the conditions of particular media features. State true or false.
a) True
b) False
Answer
Answer: a [Reason:] Self-explainatory.
CSS MCQ Set 5
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
Answer
Answer: b [Reason:] 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
Answer
Answer: b [Reason:]
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
Answer
Answer: c [Reason:]
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
Answer
Answer: d [Reason:]
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
Answer
Answer: b [Reason:]
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
Answer
Answer: c [Reason:]
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
Answer
Answer: b [Reason:]
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
Answer
Answer: d [Reason:]
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
Answer
Answer: c [Reason:]
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
Answer
Answer: d [Reason:]
Syntax: display: inline | block | list-item