Type Here to Get Search Results !

CSS Exam Question and Answer

BUY A PDF BOOK ON THIS TOPIC






1. Which CSS property is used to change the background color of an element?

A) color

B) background-color

C) text-color

D) bgcolor

Answer: B) background-color

 

2. Which CSS property is used to set the text color of an element?

A) color

B) text-color

C) font-color

D) text-style

Answer: A) color

 

3. What is the correct CSS syntax for making all <p> elements have a font size of 16 pixels?

A) p {font-size: 16px;}

B) paragraph {font-size: 16px;}

C) <p> {font-size: 16px;}

D) .p {font-size: 16px;}

Answer: A) p {font-size: 16px;}

 

4. Which CSS property is used to control the space between individual letters in a text?

A) letter-spacing

B) word-spacing

C) text-spacing

D) spacing

Answer: A) letter-spacing

 

5. What does CSS stand for?

A) Computer Style Sheets

B) Creative Style Sheets

C) Cascading Style Sheets

D) Colorful Style Sheets

Answer: C) Cascading Style Sheets

 

6. How can you apply multiple background images to an element in CSS?

A) background-image: url(image1.jpg), url(image2.jpg);

B) background-multiple: url(image1.jpg) url(image2.jpg);

C) background: url(image1.jpg), url(image2.jpg);

D) multiple-background-image: url(image1.jpg), url(image2.jpg);

Answer: C) background: url(image1.jpg), url(image2.jpg);

 

7. Which CSS property is used to control the space between lines of text?

A) spacing

B) line-height

C) text-spacing

D) line-spacing

Answer: B) line-height

 

8. How can you center align text horizontally in CSS?

A) text-align: center;

B) align: center;

C) horizontal-align: center;

D) center-align: horizontal;

Answer: A) text-align: center;

 

9. Which CSS property is used to add shadows to text?

A) text-shadow

B) shadow

C) font-shadow

D) text-effect

Answer: A) text-shadow

 

10. Which CSS property is used to add rounded corners to an element?

A) border-radius

B) corner-radius

C) rounded-corners

D) curve

Answer: A) border-radius

 

11. How do you include a comment in CSS?

A) <!-- This is a comment -->

B) // This is a comment //

C) /* This is a comment */

D) <!--- This is a comment --->

Answer: C) / This is a comment /

 

12. Which CSS property is used to control the visibility of an element?

A) display

B) visibility

C) hidden

D) visible

Answer: B) visibility

 

13. What does the 'C' in CSS stand for?

A) Cascading

B) Creative

C) Computer

D) Colorful

Answer: A) Cascading

 

14. Which CSS property is used to control the space around elements?

A) margin

B) padding

C) spacing

D) gutter

Answer: A) margin

 

15. What is the default value of the 'position' property in CSS?

A) static

B) fixed

C) relative

D) absolute

Answer: A) static

 

16. How do you include an external CSS file in HTML?

A) <css src="style.css">

B) <style href="style.css">

C) <link rel="stylesheet" href="style.css">

D) <link href="style.css">

Answer: C) <link rel="stylesheet" href="style.css">

 

17. Which CSS property is used to make text bold?

A) bold

B) font-weight

C) text-weight

D) font-style

Answer: B) font-weight

 

18. What is the purpose of the CSS 'float' property?

A) To move elements to the right

B) To remove elements from the document flow

C) To align text within an element

D) To position elements side by side

Answer: D) To position elements side by side

 

19. Which CSS property is used to add a background image to an element?

A) image

B) background-image

C) background

D) bg-image

Answer: B) background-image

 

20. How can you make an element appear above all other elements on the page using CSS?

A) z-index: highest;

B) position: absolute;

C) top: 100%;

D) z-index: 9999;

Answer: D) z-index: 9999;

 

21. What CSS property is used to set the font size of text?

A) font-style

B) font-size

C) text-size

D) font-height

Answer: B) font-size

 

22. Which CSS property is used to make text italic?

A) text-style

B) font-style

C) text-italic

D) font-italic

Answer: B) font-style

 

23. The CSS property "text-align" is used for what purpose?

A) Adjusting font alignment

B) Aligning images within text

C) Aligning text within its container

D) Aligning text vertically

Answer: C) Aligning text within its container

 

24. What is the default value for the CSS property "text-decoration"?

A) underline

B) line-through

C) none

D) overline

Answer: C) none

 

25. The CSS property "border-radius" is used for:

A) Changing the color of the border

B) Adjusting the width of the border

C) Adding rounded corners to elements

D) Creating a dashed border

Answer: C) Adding rounded corners to elements

 

26. What CSS property is used to set the thickness of a border?

A) border-width

B) border-thickness

C) border-size

D) border-strength

Answer: A) border-width

 

27. Which CSS property is used to specify the image to be used as a border around an element?

A) border-image-source

B) border-image-url

C) image-border

D) border-img

Answer: A) border-image-source

 

28. The CSS property "background-image" is used for:

A) Adding a border to an element

B) Adding an image as a background to an element

C) Changing the font of text

D) Changing the color of the text background

Answer: B) Adding an image as a background to an element

 

29. How can you make an image grayscale using CSS?

A) filter: grayscale(100%)

B) image-grayscale: 100%

C) grayscale-image: true

D) effect: grayscale

Answer: A) filter: grayscale(100%)

 

30. What is the CSS property used to set the transparency of an image?

A) image-opacity

B) opacity

C) transparent

D) image-transparency

Answer: B) opacity

 

31. The CSS property "object-fit" is used for what purpose?

A) Adjusting the size of the image

B) Aligning text around images

C) Controlling how the content of replaced elements is resized

D) Adjusting the transparency of images

Answer: C) Controlling how the content of replaced elements is resized

 

32. What CSS property is used to position a background image?

A) background-position

B) image-position

C) position-image

D) background-img-position

Answer: A) background-position

 

33. What is the default value of the "background-repeat" property in CSS?

A) repeat

B) no-repeat

C) repeat-x

D) repeat-y

Answer: A) repeat

 

34. How can you set a background image to be fixed while the rest of the page scrolls?

A) background-scroll: fixed;

B) background-attachment: fixed;

C) image-attachment: fixed;

D) background-fixed: true;

Answer: B) background-attachment: fixed;

 

35. Which CSS property is used to add a shadow effect to text?

A) text-shadow

B) shadow-text

C) text-effect

D) text-outline

Answer: A) text-shadow

 

36. What CSS property is used to add space between the letters of text?

A) word-spacing

B) character-spacing

C) letter-spacing

D) text-spacing

Answer: C) letter-spacing

 

37. The CSS property "border-style" is used for:

A) Adjusting the width of the border

B) Changing the color of the border

C) Defining the style of the border

D) Adding rounded corners to elements

Answer: C) Defining the style of the border

 

38. How can you make an image appear in the background but not repeat?

A) background-repeat: no-repeat;

B) background-repeat: none;

C) background-repeat: single;

D) background-repeat: once;

Answer: A) background-repeat: no-repeat;

 

39. What CSS property is used to set the alignment of text within its container vertically?

A) text-align

B) vertical-align

C) align-items

D) line-height

Answer: B) vertical-align

 

40. The CSS property "object-position" is used for what purpose?

A) Adjusting the size of the image

B) Aligning text around images

C) Controlling the position of the replaced element's content

D) Adjusting the transparency of images

Answer: C) Controlling the position of the replaced element's content

41. Which CSS selector is used to select elements with a specific class?

A) #class

B) .class

C) $class

D) @class

Answer: B) .class

 

42. What is the purpose of the '*' selector in CSS?

A) Selects all elements

B) Selects the first child element

C) Selects the last child element

D) Selects only text elements

Answer: A) Selects all elements

 

43. Which of the following is an example of a CSS pseudo-element?

A) :before

B) ::after

C) !important

D) ~next

Answer: B) ::after

 

44. In CSS, which property is used to change the background color of an element?

A) color

B) background-color

C) background

D) bgcolor

Answer: B) background-color

 

45. Which CSS file extension is used for importing other CSS files into the current one?

A) .style

B) .import

C) .link

D) .css

Answer: D) .css

 

46. How do you link an external CSS file to an HTML document?

A) <style src="styles.css">

B) <link rel="stylesheet" href="styles.css">

C) <style>styles.css</style>

D) <stylesheet>styles.css</stylesheet>

Answer: B) <link rel="stylesheet" href="styles.css">

 

47. Which CSS property is used to specify the space between the borders of adjacent cells in a table?

A) padding

B) border-spacing

C) margin

D) cellspacing

Answer: B) border-spacing

 

48. Which of the following is not a valid CSS unit of measurement?

A) em

B) rem

C) px

D) pt

Answer: D) pt

 

49. How do you select all <p> elements that are children of a <div> element?

A) div > p

B) div p

C) div + p

D) div ~ p

Answer: B) div p

 

50. Which CSS property is used to control the order of elements in a flexible box layout?

A) order

B) flex-order

C) align-order

D) flex-flow

Answer: A) order

 

51. What does the CSS property "display: none;" do?

A) Hides the element

B) Shows the element

C) Removes the element from the DOM

D) Disables the element

Answer: A) Hides the element

 

52. Which CSS selector targets all elements that are being hovered over by the mouse pointer?

A) :hover

B) :active

C) :focus

D) :hovered

Answer: A) :hover

 

53. What does the CSS property "position: fixed;" do?

A) Positions the element relative to its parent element

B) Positions the element relative to the viewport

C) Positions the element relative to the browser window

D) Positions the element absolutely within its container

Answer: B) Positions the element relative to the viewport

 

54. Which CSS selector is used to select an element with a specific id?

A) .id

B) #id

C) $id

D) @id

Answer: B) #id

 

55. Which CSS property is used to add shadows to elements?

A) shadow

B) box-shadow

C) text-shadow

D) element-shadow

Answer: B) box-shadow

 

56. In CSS, which property is used to control the transparency of an element?

A) opacity

B) transparency

C) visibility

D) filter

Answer: A) opacity

 

57. What is the default value of the "position" property in CSS?

A) relative

B) absolute

C) fixed

D) static

Answer: D) static

 

58. Which CSS selector targets the first element among siblings of its type?

A) :first-child

B) :first-of-type

C) :first

D) :first-element

Answer: A) :first-child

 

59. Which CSS property is used to specify the style of the outer borders of a box?

A) border-style

B) border

C) border-collapse

D) border-width

Answer: B) border

 

60. What does the CSS property "overflow: hidden;" do?

A) Hides the element's overflow content

B) Displays the element's overflow content

C) Scrolls the element's overflow content

D) Wraps the element's overflow content

Answer: A) Hides the element's overflow content

 

61. Which HTML tag is used to link an external CSS file?

A) <style>

B) <link>

C) <css>

D) <script>

Answer: B) <link>

 

62. Which CSS property is used to set the background color of an element?

A) color

B) background-color

C) bgcolor

D) background

Answer: B) background-color

 

63. What is the default value of the position property in CSS?

A) fixed

B) absolute

C) static

D) relative

Answer: C) static

 

64. Which CSS property is used to control the text size of an element?

A) font-size

B) text-size

C) size

D) text-font

Answer: A) font-size

 

65. How do you select an element with id "example" in CSS?

A) .example

B) #example

C) $example

D) *example

Answer: B) #example

 

66. What is the syntax for setting multiple CSS properties simultaneously?

A) Using separate lines for each property

B) Using commas to separate property-value pairs

C) Using semicolons to separate property-value pairs

D) Using periods to separate property-value pairs

Answer: C) Using semicolons to separate property-value pairs

 

67. Which CSS property is used to add shadow effects to text?

A) text-shadow

B) shadow-text

C) text-effect

D) shadow-effect

Answer: A) text-shadow

 

68. Which CSS property is used to control the space between lines of text?

A) spacing

B) line-height

C) text-spacing

D) line-spacing

Answer: B) line-height

 

69. How do you specify the font family in CSS?

A) font-family

B) text-family

C) family-font

D) font-type

Answer: A) font-family

 

70. What does the "C" stand for in CSS?

A) Cascading

B) Complex

C) Creative

D) Combination

Answer: A) Cascading

 

71. Which CSS property is used to make text bold?

A) font-weight

B) text-bold

C) weight

D) bold

Answer: A) font-weight

 

72. Which CSS property is used to specify the space between words in a text?

A) spacing

B) word-spacing

C) text-spacing

D) space

Answer: B) word-spacing

 

73. Which property is used to change the color of the text?

A) text-color

B) font-color

C) color

D) text-style

Answer: C) color

 

74. Which CSS property is used to change the style of the mouse cursor?

A) mouse-style

B) cursor

C) pointer

D) mouse-cursor

Answer: B) cursor

 

75. Which of the following is not a valid value for the display property in CSS?

A) inline

B) block

C) hidden

D) inline-block

Answer: C) hidden

 

76. Which CSS property is used to specify the alignment of text?

A) text-align

B) align

C) text-style

D) alignment

Answer: A) text-align

 

77. Which of the following is used to select all elements on a web page in CSS?

A) all

B) *

C) body

D) html

**Answer: B) ***

 

78. Which CSS property is used to add a border to an element?

A) border

B) border-style

C) border-width

D) border-color

Answer: A) border

 

79. Which CSS property is used to change the style of an underline on a link?

A) text-decoration

B) underline-style

C) decoration-style

D) underline

Answer: A) text-decoration

 

80 Which CSS property is used to add a background image to an element?

A) background-image

B) image

C) background

D) image-src

Answer: A) background-image

 

81. Which CSS property is used to control the space between elements in a layout?

A) margin

B) padding

C) spacing

D) gutter

Answer: A) margin

 

82. What is the default value for the overflow property in CSS?

A) hidden

B) auto

C) scroll

D) visible

Answer: D) visible

 

83. Which CSS property is used to change the style of a list item marker?

A) list-marker-style

B) marker-style

C) list-style-type

D) marker-type

Answer: C) list-style-type

 

84. Which of the following is not a valid value for the position property in CSS?

A) static

B) fixed

C) relative

D) centered

Answer: D) centered

 

85. Which CSS property is used to set the opacity of an element?

A) opacity

B) transparency

C) visibility

D) display

Answer: A) opacity

 

86. Which CSS property is used to specify the order of flexible items in a flex container?

A) order

B) flex-order

C) item-order

D) order-flex

Answer: A) order

 

87. Which CSS property is used to add rounded corners to an element?

A) border-radius

B) corner-radius

C) rounded-corners

D) curve

Answer: A) border-radius

 

88. Which CSS property is used to control the spacing between lines of text within an element?

A) line-height

B) spacing

C) line-spacing

D) text-spacing

Answer: A) line-height

 

89. What is the default value for the display property in CSS?

A) inline

B) block

C) inline-block

D) none

Answer: B) block

 

90. Which CSS property is used to specify the placement of an element relative to its normal position?

A) position

B) placement

C) relative-position

D) element-position

Answer: A) position

 

91. Which CSS property is used to change the size of an element's content area?

A) content-size

B) size

C) width

D) content-width

Answer: C) width

 

92. Which CSS property is used to specify the type of positioning method used for an element?

A) position-type

B) positioning

C) placement

D) position

Answer: D) position

 

93. Which CSS property is used to specify the behavior of the background image when the content of an element is larger than the background image?

A) background-repeat

B) background-size

C) background-clip

D) background-origin

Answer: B) background-size

 

94. Which CSS property is used to specify the minimum width of an element?

A) min-width

B) width-min

C) min-size

D) width

Answer: A) min-width

 

95. Which CSS property is used to specify the position of the background image within its container?

A) background-position

B) position

C) background-align

D) image-position

Answer: A) background-position

 

96. Which CSS property is used to specify the shadow color of an element's box?

A) box-shadow-color

B) shadow-color

C) text-shadow-color

D) box-shadow

Answer: D) box-shadow

 

97. Which CSS property is used to specify the style of the border on the left side of an element?

A) border-left

B) border-style-left

C) border-left-style

D) border-style

Answer: C) border-left-style

 

98. Which CSS property is used to specify the opacity level of an element's background color?

A) background-opacity

B) opacity

C) color-opacity

D) background-color-opacity

Answer: B) opacity

 

99. Which CSS property is used to specify the stacking order of elements?

A) stacking-order

B) z-index

C) order

D) layer

Answer: B) z-index

 

100. Which CSS property is used to specify the style of the border on an element?

A) border-style

B) border

C) style

D) border-width

Answer: A) border-style

 

101. Which CSS property is used to specify the distance between the border and the content of an element?

A) margin

B) padding

C) spacing

D) gutter

Answer: B) padding

 

102. Which CSS property is used to specify the style of the cursor when hovering over an element?

A) hover

B) cursor-style

C) cursor

D) pointer

Answer: C) cursor

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.