CSS MCQ. Cascading style sheet most important Questions and Answers PDF for all Competitive Exams in like COPA, O level etc. These are the Most important Question for all Computer related IT Exam papers.
Size: 932.76 KB
Language: en
Added: Nov 10, 2024
Slides: 20 pages
Slide Content
CSS Most important Questions for All Exams
1. How can we change the background color of an element?
a) background-color
b) color
c) Both A and B
d) None of these
Ans. a
2. Which is the correct CSS syntax?
a) body: color = black;
b) body {color; black}
c) {body: color : black;}
d) {body : color = black;}
Ans. b
3. How can we select an element with a specific ID in CSS?
a) #
b) .
c) !
d) None of these
Ans. a
4. How can we select an element with a specific Class in CSS?
a) #
b) .
c) !
d) None of these
Ans. b
5. Can negative values be allowed in padding property?
a) Yes
b) No
c) Depends on property
d) None of these
Ans. b
6. The CSS property used to specify the transparency of an element is?
a) opacity
b) visibility
c) filter
d) None of these
Ans. a
7. How can we specify the spacing between each letter in a text in CSS?
a) alpha-spacing b) letter-spacing
c) character-spacing d) None of these
Ans. b
8. We can make rounded borders around element using which CSS element?
a) border-collapse
b) border-round
c) border-radius
d) None of these
Ans. c
9. Which of the following property specifies the look and design of an outline?
a) outline-style
b) outline
c) outline-font
d) None of these
Ans. a
10. Which of the following are valid CSS position property values?
a) static
b) relative
c) fixed
d)All of these
Ans. d
11. Which of the following CSS property is used to controlling the layout?
a) display
b) color
c) text
d) None of these
Ans. a
12. Which of the following CSS property specifies the origin of the background image?
a) background-origin
b) background-size
c) origin
d) None of these
Ans. a
13. How are custom fonts defined using CSS?
a) @font-face rule b) Custom fonts cannot be defined
c) src tags d) None of these
Ans. a
14. Which of the following are parts of the CSS box model?
a) Margins b) Borders c) Padding d) All of these
Ans. d
15. Which of the following components of the CSS box model are transparent?
a) Padding
b) Margin
c) Both A and B
d) Content
Ans. c
16. Which of the following can be achieved with CSS lists?
a) Set different list item markers for ordered lists
b) Set different list item markers for unordered lists
c) Set an image as the list item marker
d) All of these
Ans. d
17. Which of the following CSS property specifies the type of list item marker?
a) list
b) list-style-type
c) ul
d) ol
Ans. b
18. What value should be passed to the width parameter if we want an element,say a table, to span the
entire width of the screen?
a) 100%
b) 50%
c) 0%
d) None of these
Ans. a
19. Which of the following properties is used to align text in CSS?
a) text-align
b) text-alignment
c) text
d) text-position
Ans. a
20. Which of the following is the correct approach to make a table responsive?
a) overflow-x: auto b) overflow-x: none
c) Both A and B d) None of these
Ans. a
21. Which of the following CSS properties specifies the stack order of elements?
a) z-index b) overlap c) No such specific properties is present d) None of these
Ans. a
22. What are the uses of CSS pseudo-elements?
a) Style specified parts of an element
b) Style the first letter or line of an element
c) Insert content before or after the element
d) All of the above
Ans. d
23. How can we select elements with a specified attribute in CSS?
a) [attribute] selector
b) [property] selector
c) Both A and B
d) None of these
Ans. a
24. Which of the following are types of length units in CSS?
a) Absolute
b) Relative
c) Both A and B
d) None of these
Ans. c
25. What parameter does the calc() function in CSS take?
a) A sentence
b) A mathematical expression
c) A number
d) None of these
Ans. b
26. How can we add more importance to a property/value than normal?
a) !important
b) important
c) bold
d) None of these
Ans. a
27. Which CSS property specifies the painting area of the background?
a) background-size b) background-clip
c) background-image d) None of these
Ans. b
28. What are the different types of gradients in CSS?
a) Linear Gradients b) Conic Gradients c) Radial Gradients d) All of these
Ans. d
29. Which CSS property is used to create an image reflection?
a) box-reflect
b) image-reflect
c) reflect-img
d) None of these
Ans. a
30. The transparent keyword is equivalent to which RGBA() value in CSS?
a) RGBA(0, 0, 0, 1)
b) RGBA(255, 255, 255, 1)
c) RGBA(0, 0, 0, 0)
d) RGBA(255, 255, 255, 0)
Ans. c
31. What function is used to insert values of a CSS variable?
a) var()
b) rand()
c) varchar()
d) calc()
Ans. a
32. What is the general syntax of writing the var() function?
a) var(--name, value)
b) var(--name)
c) var(value)
d) None of these
Ans. a
33. The CSS property used to control the element’s font size is –
a) text-style
b) text-size
c) font-size
d) None of these
Ans. c
34. The HTML attribute used to define the internal stylesheet is –
a) <style> b) style
c) <link> d) <script>
Ans. a
35. Which of the following is the correct syntax to make the background-color of all paragraph elements to
yellow?
a) p {background-color : yellow;} b) p {background-color : #yellow;}
c) all {background-color : yellow;} d) all p {background-color : #yellow;}
Ans. a
36. Which of the following is the correct syntax to display the hyperlinks without any under line?
a) a {text-decoration : underline;}
b) a {decoration : no-underline;}
c) a {text-decoration : none;}
d) None of these
Ans. c
37. What is CSS?
a) CSS is a style sheet language
b) CSS is designed to separate the presentation and content, including layout, colors, and fonts
c) CSS is the language used to style the HTML documents
d) All of the mentioned
Ans. d
38. Which of the following tag is used to embed css in html page?
a) <css>
b) <!DOCTYPE html>
c) <script>
d) <style>
Ans. d
39. Which of the following CSS selectors are used to specify a group of elements?
a) tag
b) id
c) class
d) both class and tag
Ans. c
40. Which of the following has introduced text, list, box, margin, border, color, and background properties?
a) HTML
b) PHP
c) CSS
d) Ajax
Ans. c
41. Which of the following CSS framework is used to create a responsive design?
a) django b) rails c) larawell d) bootstrap
Ans. d
42. Which of the following CSS property is used to make the text bold?
a) text-decoration: bold b) font-weight: bold
c) font-style: bold d) text-align: bold
Ans. b
43. Which of the following CSS style property is used to specify an italic text?
a) style
b) font
c) font-style
d) @font-face
Ans. c
44. Which of the following are the CSS Extension Prefixes for Webkit?
a) -chrome
b) -web
c) -o-
d) –webkit
Ans. d
45. Which of the following is the first CSS specification to become an official W3C Recommendation?
a) CSS level 2
b) (X)HTML CSS
c) CSS level 1
d) CSS level 2.1
Ans. c
46. Which of the following CSS property can be used to set the image as a border instead of the border
style?
a) background-image-source
b) background-image
c) border-image-source
d) border-image
Ans. c
47. Which of the following is the correct way to apply CSS Styles?
a) in an external CSS file
b) inside an HTML element
c) inside the <head> section of an HTML page
d) all of the mentioned
Ans. d
48. Which of the following is not the property of the CSS box model?
a) margin b) color c) width d) height
Ans. b
49. What will be the output of the following CSS code snippet?
span {
border: 1px solid red;
outline: green dotted thick;
}
a) All span elements will have a green thick border and a red outline
b) All span elements will have a red border and a green dotted outline
c) All span elements will have a outer green dotted border and an inner red border
d) All span elements will have an outer red border and inner green dotted border
Ans. c
50. Which of the following CSS property is used to set the color of the text?
a) text-decoration
b) pallet
c) colour
d) color
Ans. d
51. Which of the following CSS property is used to set the color of the text?
a) text-decoration
b) pallet
c) colour
d) color
Ans. b
52. Which of the following is an appropriate value for the overflow element?
a) scroll
b) hidden
c) auto
d) all of the mentioned
Ans. d
53. Which of the following CSS property is used to specify table borders in CSS?
a) table:border
b) table
c) border
d) none of the mentioned
Ans. c
54. Which of the following CSS property defines the space between cells in a table?
a) border-spacing b) border-style
c) border d) none of the mentioned
Ans. a
55. Which of the following CSS3 property can be used to allow line breaks within words?
a) line-break b) line-wrap c) word-wrap d) word-break
Ans. d
56. In CSS, h1 can be called as _______
a) Selector
b) Attribute
c) Value
d) Tag
Ans. a
57. In css, “color:red” can be called as _____________
a) Selector
b) Rule
c) Declaration
d) Value
Ans. c
58. In CSS, “font-size” can be called as ________
a) Selector
b) Rule
c) Property
d) Property-Name
Ans. d
59. Which one of these is NOT an appropriate value for the font-variant property?
a. small-caps
b. large-caps
c. default
d. inherit
Answer: (b) large-caps
60. Which value is a slightly bolder weight than the standard bold in the font attribute?
a. dark
b. lighter
c. light
d. emphasize
Answer: (a) dark
61. The CSS property that is equivalent to the align attribute is:
a. text-align b. float
c. text-align & float d. centre
Answer: (b) float
62. Which one is NOT the audio element’s attribute?
a. check b. controls c. loop d. src
Answer: (a) check
63. Which property sets the actual amount of spacing between the various letters?
a. letter-spacing b. letter-space
c. line-height d. space
Answer: (b) letter-space
64. 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
Ans. d
65. 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
Ans. d
66. 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
Ans. b
67. 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
Ans. d
68. 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
Ans. a
69. 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;">
Ans. d
70. 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
Ans. c
71. 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
Ans. d
72. 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
Ans. a
73. What are the valid values of text-align property?
a) left, middle, right
b) left, center, right
c) left, center, right, justify
d) left, middle, right, justify
Ans. c
74. 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
Ans. a
75. 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
Ans. d
76. Which CSS property is used to specify the space between lines?
a) line-space b) line-spacing
c) line-padding d) line-height
Ans. d
77. 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
Ans. a
78. 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.
Ans. b
79. 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
Ans. a
80. 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
Ans. a
81. 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
Ans. d
82. Which CSS property sets the vertical alignment of an element?
a) vertical-align b) vertical-text-align
c) text-valign d) vertical-align-text
Ans. a
83. 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;
Ans. d
84. 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
Ans. b
85. 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;
Ans. d
86. 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
Ans. a
87. Which CSS property specifies the type of positioning method used for an element?
a) positions
b) text-position
c) positioning
d) position
Ans. d
88. HTML elements are positioned ___ by default.
a) static
b) fixed
c) relative
d) none
Ans. a
89. 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
Ans. d
90. Which CSS function uses the largest value?
a) large() b) maximum() c) max_value() d) max()
Ans. d
91. Which CSS function uses the smallest value?
a) small()
b) minimum()
c) min_value()
d) min()
Ans. d
92. In how many ways can CSS be added to HTML?
a) One
b) Two
c) Three
d) Infinite
Ans. c
93. 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
Ans. a
94. In this line of code, identify the selector ___.
p {border: 2px solid blue;}
a) p
b) border
c) 2px
d) None of these
Ans. a
95. How many color names does CSS supports?
a) 140
b) 100
c) 75
d) 90
Ans. a
96. __ means 4 times the size of the current font.
a) 4px b) 4 pt. c) 4em d) 4vw
Ans. c
97. Amongst the following browsers, which browser supports almost all the CSS properties?
a) Firefox b) Safari c) Google Chrome d) Opera
Ans. c
98. What is the CSS Entity for the character '#'?
a) 0023
b) 0026
c) 0027
d) None of the these
Ans. a
99. Which selector selects the markers of list items?
a) :: marker
b) .marker
c) ::selector
d) None of these
Ans. a
100. Which is the most widely used font in customizing web pages?
a) Times New Roman
b) Georgia
c) Arial
d) Garamond
Ans. c (Arial (sans-serif) is the most widely used font on web pages._
101. Which of these units of length is supported by Chrome Version 1.0?
a) rem
b) px
c) vw
d) vh
Ans. b
102. 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;
Ans. a
103. The default value of justify-content property is ___.
a) flex-start b) flex-end
c) space-between d) None
Ans. a
104. 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
Ans. a
105. Which cursor property value indicates that the program is busy?
a) help b) default c) auto d) wait
Ans. d
106. Which CSS property is not supported by the Firefox browser?
a) text-indent
b) scroll- behavior
c) overflow
d) viewport
Ans. d
107. Which one is a fallback font?
a) Times New Roman
b) Georgia
c) Serif
d) None of these
Ans. c
108. Where do we store external stylesheets?
a) HTML files
b) CSS files
c) Folder
d) None of these
Ans. b
109. The Extension of CSS file is _____.
a) .css
b) .csf
c) .c
d) .cf
Ans. a
110. 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
Ans. b
111. The Hex Code for the red color is ___.
a) #FF0000 b) #F0F000 c) #F0000F d) None of these
Ans. a
112. In CSS, what does HSL stands for?
a) hue, standard, light
b) height, standard, line-width
c) hue, saturation, lightness
d) hue, standard, line-width
Ans. c
113. Among the following CSS properties, which property is not a shorthand property?
a) background
b) padding
c) display
d) border
Ans. c
114. 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
Ans. d
115. The CSS border property specifies the style, color, and ___ of an element's border.
a) length
b) size
c) width
d) area
Ans. c
116. What is the default size for normal text, like paragraphs?
a) 11px
b) 12px
c) 16px
d) 18px
Ans. c
117. Which of the tag is used to attach css file in html document?
a) <link> b) <css> c) <script> d) <html>
Ans. a
118. Which of the following css property used to defines the space between cells in table?
a) border-spacing b) space-between
c) border-style d) None of the above
Ans. a
119. which css property is used to show arrow as cursor?
a) pointer
b) arrow
c) default
d) arr
Ans. c
120. If we want define style for an unique element, then which css selector will we use ?
A. Id
B. text
C. class
D.name
Ans. a
121. Where is an HTML document is the correct place to refer to an external style sheet?
a) In the <head> section
b) At the end of the document
c) In the <body> section
d) In the <p> section
Ans. a
122. How do you add a background color for all <h1> elements?
a) all.h1 {background-color:#FFFFFF;}
b) h1.all {background-color:#FFFFFF;}
c) h1 {background-color:#FFFFFF;}
d) All of these
Ans. c
123. What is the correct CSS syntax for making all the <p> elements bold?
a) <p style=”text-size:bold;”>
b) p {text-size:bold;}
c) <p style=”font-size:bold;”>
d) p {font-weight:bold;}
Ans. d
124. How do you select all p elements inside a div element?
a) div + p b) div p
c) div.p d) All of these
Ans. b
125. How do you group selectors?
a) Separate each selector with a comma
b) Separate each selector with a plus sign
c) Separate each selector with a space
d) All of these
Ans. a
1. What is the full form of CSS?
a) Cascading Style Sheets
b) Colored Special Sheets
c) Computer Style sheet
d) Computer System Sheet
2. In how many ways can CSS be written in?
a) 1
b) 2
c) 3
d) 4
3. What type of CSS is the following code snippet?
<h1 style="color:blue;">A Blue Heading</h1>
a) Inline
b) Internal
c) External
d) None of these
4. What type of CSS is generally recommended for designing large web page?
a) Inline
b) Internal
c) External
d) None of these
5. Which HTML tag is used to declare internal CSS?
a) <style>
b) <link>
c) <script>
d) None of these
6. How can we write comments in CSS?
a) /* */
b) //
c) #
d) All of these
7. In the below code snippet, in what order will the margins be added?
p {
margin: 25px 50px 75px 100px;
}
a) Top, Right, Bottom, Left b) Top, Left, Bottom, Right
c) Top, Bottom, Right, Left d) Right, Left, Top, Bottom
8. What is the correct syntax for referring an external CSS?
a) <link rel=”stylesheet” type=”text/css” href=”style.css”>
b) <style rel=”stylesheet” type=”text/css” href=”style.css”>
c) Both A and B
d) None of the above
9. Which of the following are valid ways to represent a colour in CSS?
a) A valid color name
b) RGB values
c) HEX values
d) All of these
10. What will be the width of the div element given below?
div {
width: 310px;
padding: 20px;
border: 5px solid blue;
margin: 0;
}
a) 310px
b) 350px
c) 360px
d) 320px
Click here for Answers
Computer Best MCQ Book in Just Rs.29/- [7000+ Question in English]
https://bharatskills.in/best-computer-mcq-book-for-competitive-exams/
Computer Best MCQ Book in Just Rs.25/- (2100+ Question in Hindi)
https://bharatskills.in/computer-mcq-book-in-hindi-pdf/