BY ELRayeK
CSS MCQS
1. What is CSS stands for?
A. Cascading Style Sheets
B. Cascade Style Sheet
C. Color Style Sheets
D. Color Style Sheet
2. What CSS describes?
A. CSS describes how calculation perform on button click.
B. CSS describes how HTML elements are to be displayed on screen, paper, or in
other media
C. Both A. and B.
D. None of the above
3. What is the correct syntax for referring an external CSS?
A. <link rel="stylesheet" type="text/css" href="mystyle.css">
B. <stylesheet rel="stylesheet" type="text/css" href="mystyle.css">
C. <style rel="stylesheet" type="text/css" href="mystyle.css">
D. All of the above
4. What is a CSS selector?
A. A CSS selector is the CSS class name
B. A CSS selector is the set of properties that are going to be applied on HTML
elements
C. A CSS selector is name of CSS file.
D. A CSS selector is the first part of a CSS Rule. It may an HTML element or
pattern of elements.
5. In a CSS file, there is a CSS rule for paragraphs tags – what does p can be
called?
A. Selector
B. Attribute
C. Property
D. Tag
6. Internal styles are written within the _____ element.
BY ELRayeK
A. <style>…</style>
B. <css>…</css>
C. <stylesheet>…</stylesheet>
D. Both A. and B.
7. Inline styles are written within the _____ attribute.
A. style
B. css
C. stylesheet
D. Both A. and B.
8. CSS comments are placed within the ______.
A. //
B. /* and */
C. <* and *>
D. <! And !>
9. Can comments also span multiple lines?
A. Yes
B. No
10. Which property is used to define the text color?
A. text-color
B. color
C. font-color
D. Both A. and B.
11. Which property is used to define the background color?
A. bgcolor
B. bg-color
C. background
D. background-color
12. From the given options which is/are the valid way to represent a color?
A. A valid color name like "blue"
B. HEX code like "#0000ff"
C. RGB Value like "rgb(0,0,255)
D. All of the above
BY ELRayeK
13. Which property is used to define the font of the element's text?
A. font
B. font-family
C. font-style
D. All of the above
14. To make a text italic, which CSS property is used?
A. font
B. font-family
C. font-style
15. What are the valid values of font-style property?
A. italic, bold, bolder
B. normal, bold, italic
C. underline, bold, italic
D. inherit, italic, normal, oblique
16. Why font-weight property is used?
A. Sets how thick or thin characters in text should be displayed.
B. Sets the size of the font
C. Both A. and B.
D. None of the above
17. What is/are the correct value(s) of font-weight property?
A. bold, italic, underline
B. normal, bold, italic
C. normal, bold, bolder, lighter, initial, and inherit
D. None of the above
18. Which is the correct inline CSS for p tag to define paragraph's text and
background colors?
A. <p css="color: red; background-color: yellow;">
B. <p cssstyle="color: red; background-color: yellow;">
C. <p inline="color: red; background-color: yellow;">
D. <p style="color: red; background-color: yellow;">
19. What is the correct syntax of border property in CSS?
A. border: border-width border-style border-color
BY ELRayeK
B. border: border-color border-width border-style
C. border: border-style border-width border-color
D. All of the above
20. Which of the following is the correct syntax to display the hyperlinks
without any underline?
A. a {text-decoration : underline;}
B. a {text-decoration : none;}
C. a {text-decoration : block;}
D. None of the above
21. Which of the following is the correct syntax to remove the underline on
hyperlinks and visited hyperlinks?
A. a {text-decoration : underline;}, a:visited {text-decoration : underline;}
B. a {text-decoration : block;}, a:visited {text-decoration : block;}
C. a {text-decoration : none;}, a:visited {text-decoration : none;}
D. None of the above
22. Which CSS property is used to style the hyperlinks on hover (Mouse over)?
A. a:mouseover
B. a:move
C. a:mover
D. a:hover
23. If you want to use a green dotted border around an image, which CSS
property is used for that?
A. border-style
B. border-color
C. border-decoration
D. Both A. and B.
24. Which CSS property and value is used to center an element?
A. text-align:center
B. align:center
C. text-align:middle
D. align:middle
25. What are the valid values of text-align property?
A. left, middle, right
BY ELRayeK
B. left, center, right
C. left, center, right, justify
D. left, middle, right, justify
26. What is the use of "text-align:justify" in CSS?
A. Stretches the lines so that each line has equal width
B. Stretches the lines so that each line can be arranged in left alignment
C. Stretches the lines so that each line can be arranged in right alignment
D. None of the above
27. Which CSS property is used to specify the indentation of the first line of a
text?
A. text-align
B. padding-left
C. margin-left
D. text-indent
28. Which CSS property is used to specify the space between the characters in a
text?
A. text-space
B. letter-space
C. letter-spacing
D. letter-distance
29. Which CSS property is used to specify the space between lines?
A. line-space
B. line-spacing
C. line-padding
D. line-height
30. Which CSS property is used to specify the space between the words in a
text?
A. word-spacing
B. word-padding
C. word-height
D. characters-spacing
31. Which CSS property adds shadow to text?
A. content-shadow
BY ELRayeK
B. text-shadow
C. word-shadow
D. text-outline
32. Which CSS property is used to specify uppercase and lowercase letters in a
text?
A. text-transform
B. text-case
C. case
D. text-casing
33. Which is the correct CSS statement to capitalize the first letter of each
word?
A. text-transform: uppercase
B. text-transform: capitalize
C. text-transform: sentence
D. Both A. and B.
34. What are the valid values of text-transform property?
A. uppercase, lowercase, and capitalize
B. uppercase, lowercase, capitalize, and sentence
C. upper, lower, and capital
D. upper, lower, capital, and sentence
35. What are the valid values of "text-decoration" property?
A. overline, line-through, underline, and none
B. overline, strike, line-through, underline, and none
C. double-line, overline, line-through, underline, and none
D. None of these
36. Which CSS property specifies how to align the last line of a text?
A. text-align
B. last-text-align
C. text-align-last-line
D. text-align-last
37. Which CSS property sets the vertical alignment of an element?
A. vertical-align
B. vertical-text-align
BY ELRayeK
C. text-valign
D. vertical-align-text
38. What are the valid values of vertical-align property?
A. baseline, text-top, text-bottom, subscript, and superscript
B. baseline, top, bottom, sub, and super
C. baseline, text-top, text-bottom, sub, and super
D. base, text-top, text-bottom, sub, and super
39. Which is the correct CSS statement to define multiple font families?
A. font: "Times New Roman", Times, serif;
B. font-name: "Times New Roman", Times, serif;
C. font-family: "Times New Roman, Times, serif";
D. font-family: "Times New Roman", Times, serif;
40. Which CSS property specifies the type of list item marker?
A. list-style
B. list-style-type
C. list-style-circle
D. list-style-square
41. Which is the correct CSS statement is used to remove the markers/bullets?
A. list-style: none;
B. list-style-type: 0;
C. list-style-type: blank;
D. list-style-type: none;
42. Which CSS property specifies an image as the list item marker?
A. list-style-image
B. list-style-picture
C. list-style-background
D. list-style-bgimage
43. Which CSS property specifies if/how an element is displayed?
A. block
B. display
C. element-display
D. element-block
BY ELRayeK
44. Which CSS property specifies the type of positioning method used for an
element?
A. positions
B. text-position
C. positioning
D. position
45. HTML elements are positioned ___ by default.
A. static
B. fixed
C. relative
D. none
46. What are the valid values for "position" property?
A. block, none, fixed, absolute, and static
B. block, static, fixed, absolute, and sticky
C. static, relative, fixed, absolute, and none
D. static, relative, fixed, absolute, and sticky
47. Which CSS property specifies the opacity/transparency of an element?
A. transparency
B. opacity
C. transform-opacity
D. opacity-all
48. Which CSS function performs a calculation to be used as the property value?
A. sum()
B. add()
C. calc()
D. addition()
49. Which CSS function uses the largest value?
A. large()
B. maximum()
C. max_value()
D. max()
50. Which CSS function uses the smallest value?
BY ELRayeK
A. small()
B. minimum()
C. min_value()
D. min()
51. In how many ways can CSS be added to HTML?
A. One
B. Two
C. Three
D. Infinite
52. The <style> in Internal CSS refers to ___.
A. Attributes
B. HTML tags
C. Selector
D. All of the above
53. Can we link multiple stylesheets to a single page?
A. Yes
B. No
C. Can't say, it depends on CSS properties
D. None of the above
54. The CSS property used to change text sizes?
A. font-family
B. font-size
C. font
D. Both A and C
55. In this line of code, identify the selector ___.
p {border: 2px solid blue;}
A. p
B. border
C. 2px
D. None of these
56. How many color names does CSS supports?
BY ELRayeK
A. 140
B. 100
C. 75
D. 90
57. The ___ property is used in the positioning of the background image.
A. background-image
B. background-position
C. padding
D. All of the above
58. ___ means 4 times the size of the current font.
A. 4px
B. 4 pt.
C. 4em
D. 4vw
59. Amongst the following browsers, which browser supports almost all the CSS
properties?
A. Firefox
B. Safari
C. Google Chrome
D. Opera
60. What is the CSS Entity for the character '#'?
A. 0023
B. 0026
C. 0027
D. None of the these
61. This selector selects all the <h> elements where the parent is a <div>
element.
A. h+p
B. h>p
C. p.h
D. p>h
62. Which selector selects the markers of list items?
A. :: marker
BY ELRayeK
B. .marker
C. ::selector
D. None of these
63. Which is the most widely used font in customizing web pages?
A. Times New Roman
B. Georgia
C. Arial
D. Garamond
64. Which of the following CSS properties are animatable?
A. color
B. border-left
C. flex
D. All of the above
65. We can give space between unit and value when assigning length values to
CSS properties.
A. True
B. False
66. Which of these units of length is supported by Chrome Version 1.0?
A. rem
B. px
C. vw
D. vh
67. Which line of code is a must to write to apply CSS Flexbox properties?
A. display: flex;
B. display: flexbox;
C. display: block;
D. flex-direction: row;
68. The default value of justify-content property is ___.
A. flex-start
B. flex-end
C. space-between
D. None
BY ELRayeK
69. Which is the correct syntax for adding animation?
A. animation: name timing-function duration
B. animation: name duration timing-function
C. animation: name delay duration
D. None of these
70. Which line of code specifies playing an animation with the same speed from
beginning to the end?
A. div {animation- timing function: linear;}
B. div {animation- timing function: ease in;}
C. div {animation- play- state: paused;}
D. div {animation- fill-mode: both;}
71. Which line of code represents a universal selector?
A. *{border: 2px solid red;}
B. body {border: 2px solid red;}
C. both A&B
D. None of these
72. Which of the following properties specify the width of the borders?
A. border-width
B. border-style
C. border
D. Both A and C
73. Is border-image property animatable?
A. Yes
B. No
74. What value is set to border: collapse property to define borders around
each cell? (Refer to the image)
BY ELRayeK
A. collapse
B. separate
C. initial
D. inherit
75. Which cursor property value indicates that the program is busy?
A. help
B. default
C. auto
D. wait
76. What does this line of code explain?
p {display: flex;}
A. All the <p> elements are displayed as a block-level flex container
B. All the <p> elements are not displayed by the browser
C. All the <p> elements are displayed as a grid container
D. All the <p> elements are displayed as an inline flex container
77. The text-align property defines the ___ alignment of text in an element.
A. horizontal
B. vertical
C. both horizontal & vertical
D. None of these
78. Does the z-index property accept negative values?
A. Yes
BY ELRayeK
B. No
79. Which CSS property is not supported by the Firefox browser?
A. text-indent
B. scroll- behavior
C. overflow
D. viewport
80. Which one is a fallback font?
A. Times New Roman
B. Georgia
C. Serif
D. None of these
81. Where do we store external stylesheets?
A. HTML files
B. CSS files
C. Folder
D. None of these
82. In the given line of code, identify the type of selector used.
#Main {background-color: yellow;}
A. CSS element selector
B. CSS id selector
C. Combinator selector
D. All of the above
83. The Hex Code for the red color is ___.
A. #FF0000
B. #F0F000
C. #F0000F
D. None of these
84. In CSS, what does HSL stands for?
A. hue, standard, light
B. height, standard, line-width
C. hue, saturation, lightness
BY ELRayeK
D. hue, standard, line-width
85. Among the following CSS properties, which property is not a shorthand
property?
A. background
B. padding
C. display
D. border
86. In this line of code, what is the use of the alt attribute?
<img src="circle.jpg" alt="It is red">
A. Adds a text description to an image
B. Provides alternative information for an image
C. To hide an image
D. Both A & B
87. The CSS border property specifies the style, color, and ___ of an element's
border.
A. length
B. size
C. width
D. area
88. To get this output, the CSS properties put to use are ___.
A. display, border, align-items, justify-content
B. display, border-width, justify-content, border-color
C. margin, display, padding-left, justify-content
89. What does 'padding: 50px 20px;' specifies?
A. top padding is 50px
B. bottom padding is 20px
C. right padding is 20px
D. Both A & C
BY ELRayeK
90. What is the default size for normal text, like paragraphs?
A. 11px
B. 12px
C. 16px
D. 18px