R4RIN
Articles
Java 8
MCQS
CSS MCQ Quiz Hub
CSS Mcq Questions
Choose a topic to test your knowledge and improve your CSS skills
1. CSS stands for -
Cascade style sheets
Color and style sheets
Cascading style sheets
None of the above
2. Which of the following is the correct syntax for referring the external style sheet?
<style src = example.css>
<style src = example.css >
<stylesheet> example.css </stylesheet>
<link rel=stylesheet type=text/css href=example.css>
3. The property in CSS used to change the background color of an element is -
bgcolor
color
background-color
All of the above
4. The property in CSS used to change the text color of an element is -
bgcolor
color
background-color
All of the above
5. The CSS property used to control the elements font-size is -
text-style
text-size
font-size
None of the above
6. The HTML attribute used to define the inline styles is -
style
styles
class
None of the above
7. The HTML attribute used to define the internal stylesheet is -
<style>
style
<link>
<script>
8. Which of the following CSS property is used to set the background image of an element?
background-attachment
background-image
background-color
None of the above
9. Which of the following is the correct syntax to make the background-color of all paragraph elements to yellow?
p {background-color : yellow;}
p {background-color : #yellow;}
all {background-color : yellow;}
all p {background-color : #yellow;}
10. Which of the following is the correct syntax to display the hyperlinks without any underline?
a {text-decoration : underline;}
a {decoration : no-underline;}
a {text-decoration : none;}
None of the above
11. Which of the following property is used as the shorthand property for the padding properties?
padding-left
padding-right
padding
All of the above
12. The CSS property used to make the text bold is -
font-weight : bold
weight: bold
font: bold
style: bold
13. Are the negative values allowed in padding property?
Yes
No
Cant say
May be
14. Which of the following property is used as the shorthand property of margin properties?
margin-left
margin-right
margin
None of the above
15. The CSS property used to specify the transparency of an element is -
opacity
filter
visibility
overlay
16. Which of the following is used to specify the subscript of text using CSS?
vertical-align: sub
vertical-align: super
vertical-align: subscript
None of the above
17. Which of the following CSS property is used to specify the space between every letter inside an element?
alpha-spacing
character-spacing
letter-spacing
alphabet-spacing
18. 18) The CSS property used to specify whether the text is written in the horizontal or vertical direction?
writing-mode
text-indent
word-break
None of the above
19. Which of the following syntax is correct in CSS to make each word of a sentence start with a capital letter?
text-style : capital;
transform : capitalize;
text-transform : capital;
text-transform : capitalize;
20. How to select the elements with the class name "example"?
example
#example
.example
Class example
21. Which of the following is the correct syntax to select all paragraph elements in a div element?p22)
div p
p
div#p
div ~ p
22. Which of the following is the correct syntax to select the p siblings of a div element?div + pdiv p23)
p
div + p
div p
div ~ p
23. The CSS property used to draw a line around the elements outside the border?24)
border
outline
padding
line
24. Which of the following CSS property is used to add shadows to the text?25)
text-shadow
text-stroke
text-overflow
text-decoration
25. Which of the following is not a value of the font-variant property in CSS?
normal
small-caps
large-caps
inherit
26. 26) Which of the following CSS property is used to specify whether the table cells share the common or separate border?border-spacing27)
border-collapse
border-radius
border-spacing
None of the above
27. The CSS property used to make the rounded borders or rounded corners around an element is -28)
border-collapse
border-radius
border-spacing
None of the above
28. The CSS property used to set the distance between the borders of the adjacent cells in the table is -
border-collapse
border-radius
border-spacing
None of the above
29. Which of the following selector in CSS is used to select the elements that do not match the selectors?
:! Selector
:not selector
:empty selector
None of the above
30. Which of the following CSS property defines how an image or video fits into container with established height and width?
object-fit
object-position
position
None of the above
31. Which type of CSS is used in the below code?
<p style = "border:2px solid red;">
Inline CSS
Internal CSS
None of the above
32. Which of the following CSS property specifies the origin of the background-image?
background-origin
background-attachment
background-size
None of the above
33. The CSS property used to set the maximum width of the elements content box is -
max-width property
height property
max-height property
position property
34. Which if the following CSS function allows us to perform calculations?
calc() function
calculator() function
calculate() function
cal() function
35. The CSS property used to set the maximum height of the elements content box is -
max-width property
height property
max-height property
position property
36. The CSS property used to set the minimum width of the elements content box is -
max-width property
min-width property
width property
All of the above
37. Which of the following CSS property is used to represent the overflowed text which is not visible to the user?
text-shadow
text-stroke
text-overflow
text-decoration
38. The CSS property which is used to define the set the difference between two lines of your content is -min-height property
text-decoration
max-height property
line-height property
None of the above
39. The CSS property which is used to define the set the difference between two lines of your content is -
min-height property
max-height property
line-height property
None of the above
40. Which of the following CSS property is used to add stroke to the text?
text-stroke property
text-transform property
text-decoration property
None of the above
41. Which of the following CSS property is used to set the blend mode for each background layer of an element?
background-blend-mode property
background-collapse property
background-transform property
background-origin property
42. The CSS property used to specify the transparency of an element is -
Hover
opacity
clearfix
overlay
43. Which of the following CSS property is used to set the horizontal alignment of a table-cell box or the block element?text-align property
text-align property
text-transform property
text-shadow property
text-decoration
44. The CSS property which is used to set the text wider or narrower compare to the default width of the font is -
font-stretch property
font-weight property
text-transform property
font-variant property
45. Which of the following CSS property is used to specify the type of quotation mark?
quotes property
z-index property
hyphens property
None of the above
46. The CSS property used to specify the order of flex item in the grid container is -order property
order property
float property
overflow property
None of the above
47. The CSS property used to set the indentation of the first line in a block of text is -
text-indent property
text-stroke property
text-decoration property
text-overflow property
48. Which of the following CSS property creates a clipping region and specifies the visible area of the element?
visibility property
background-clip property
clip-path property
None of the above
49. The correct syntax to give a line over text is -
text-decoration: line-through
text-decoration: none
text-decoration: overline
text-decoration: underline
50. If we want define style for an unique element then which css selector will we use ?
id
Text
class
name
51. If we dont want to allow a floating div to the left side of an element which css property will we use ?
margin
clear
float
padding
52. Suppose we want to arragnge five nos. of DIVs so that DIV4 is placed above DIV1. Now which css property will we use to control the order of stack?
d-index
s-index
x-index
z-index
53. If we want to show an Arrow as cursor then which value we will use ?
pointer
defalt
arrow
arr
54. If we want to use a nice looking green dotted border around an image which css property will we use?
border-color
border-decoration
border-style
border-line
55. Which of the following properties will we use to display border around a cell without any content ?
empty-cell
blank-cell
noncontent-cell
void-cell
56. What should be the table width so that the width of a table adjust to the current width of the browser window?
640 pixels
100%
full-screen
1024 px
57. Which element is used in the <HEAD> section on an HTML / XHTMLpage if we want to use an external style sheet file to decorate the page ?
&lt;src&gt;
.&lt;link&gt;
&lt;style&gt;
&lt;css&gt;
58. Which attribute can be added to many HTML / XHTML elements to identify them as a member of a specific group ?
id
div
class
span
59. When we write <img src=img.png> what img.png inside double quote implies?
element
attribute
value
operator
60. How can we write comment along with CSS code ?
/* a comment */
// a comment //
/ a comment /
.&lt; a comment&gt;
61. Which css property you will use if you want to add some margin between a DIVs border and its inner text ?
spacingB
margin
paddingD
inner-margin
62. Which CSS property is used to control the text size of an element ?
font-style
text-size
font-size
text-style
63. The default value of position attribute is _________.
fixed
absolute
inherit
relative
64. How will you make all paragraph elements RED in color ?
p.all {color: red}
all {color: #990000}
all.p {color: #998877}
p {color: red}
65. By default Hyperlinks are displayed with an underline. How do you remove the underline from all hyperlinks by using CSS code ?
a {text: no-underline}
a {text-decoration:none}
a {text-style: no-underline}
a {text-decoration: no-underline}
Submit