Here are Top 100 multiple-choice questions (MCQs) focused on the HTML5 features and elements in CSS (Cascading Style Sheets) MCQs, along with their answers and explanations.

PRACTICE IT NOW TO SHARPEN YOUR CONCEPT AND KNOWLEDGE

view hide answers

1. What does the "box-shadow" property value "inset" indicate in CSS?

  • The shadow is placed outside the element
  • The shadow is placed inside the element
  • The shadow is applied to text
  • The shadow is applied to the background

2. Which CSS property is used to control the size of an element's border on its bottom edge?

  • `border-bottom-width`
  • `border-width-bottom`
  • `border-thickness-bottom`
  • `border-bottom`

3. In CSS, what does the "box-sizing" property value "content-box" indicate?

  • The total width and height of an element includes padding and borders
  • The total width and height of an element includes only the content
  • The total width and height of an element includes margins
  • The total width and height of an element includes padding only

4. What does the "font-weight" property value "bold" indicate in CSS?

  • The text is set to uppercase letters
  • The text is set to lowercase letters
  • The text is styled as italics
  • The text is bold

5. In CSS, what does the "outline" property value "auto" indicate?

  • The element has a solid black outline
  • The element has a dashed outline
  • The outline is not applied
  • The outline is automatically determined

6. Which CSS property is used to specify the style of an element's border on its left edge?

  • `border-left`
  • `border-style-left`
  • `border-left-style`
  • `border-left-border`

7. In CSS, what does the "text-overflow" property value "ellipsis" indicate?

  • Text is aligned to the left
  • Text is aligned to the right
  • Text is styled as italics
  • Text that overflows is truncated with an ellipsis (...)

8. What does the "border-collapse" property value "separate" indicate in CSS?

  • Borders are not applied
  • Borders overlap and are adjacent
  • Borders are separated and don't overlap
  • Borders are collapsed into a single border

9. Which CSS selector targets all HTML elements on a web page?

  • Universal Selector (*)
  • Element Selector
  • Class Selector
  • ID Selector

10. Which CSS selector is used to target elements with a specific class name?

  • Universal Selector (*)
  • Element Selector
  • Class Selector (.)
  • ID Selector (#)

11. Which CSS property is used to change the text color of an element?

  • `text-color`
  • `foreground-color`
  • `color`
  • `font-color`

12. What is the purpose of the CSS property "font-family"?

  • To define the size of text
  • To specify the font of an element's text
  • To control the spacing between lines of text
  • To change the font style of an element

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

  • `line-height`
  • `text-spacing`
  • `line-spacing`
  • `text-line`

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

  • `text-color`
  • `foreground-color`
  • `background-color`
  • `color`

15. What is the purpose of the "border" property in CSS?

  • To change the font size of text
  • To define the size of an element
  • To control the text alignment
  • To specify the appearance of an element's border

16. Which CSS property is used to control the alignment of text within an element?

  • `text-align`
  • `text-center`
  • `text-justify`
  • `text-position`

17. In CSS, what is the purpose of the "margin" property?

  • To set the background color of an element
  • To define the space around an element
  • To specify the position of an element
  • To create transitions and animations

18. Which CSS selector targets elements with a specific ID attribute value?

  • Universal Selector (*)
  • Element Selector
  • Class Selector
  • ID Selector (#)

19. What does the "padding" property control in CSS?

  • The space between elements
  • The color of the text
  • The size of the text
  • The space within an element's border

20. In CSS, what is the purpose of the "position" property?

  • To change the text font
  • To create animations and transitions
  • To specify the positioning method for an element
  • To define a new HTML element

21. Which CSS property is used to specify the size of an element's text, relative to its parent element's font size?

  • `font-size`
  • `text-size`
  • `size`
  • `font-relative`

22. What is the purpose of the "float" property in CSS?

  • To control the spacing between lines of text
  • To align text within an element
  • To specify the position of an element relative to its parent
  • To change the background color of an element

23. Which CSS selector is used to target the first child element of its parent?

  • `.first-child`
  • `.last-child`
  • `.only-child`
  • `.nth-child`

24. In CSS, what is the purpose of the "z-index" property?

  • To create animations and transitions
  • To change the font of text
  • To control the visibility of an element
  • To specify the position of an element in the z-axis

25. What is the role of the "pseudo-class" in CSS?

  • To create animations and transitions
  • To define custom HTML elements
  • To apply styles to specific states of an element
  • To select elements based on their attribute values

26. Which CSS property is used to create a shadow effect for an element, providing depth and dimension?

  • `box-shadow`
  • `text-shadow`
  • `element-shadow`
  • `shadow-effect`

27. What is the purpose of the "media query" in CSS?

  • To define a new media type
  • To specify the font size of text
  • To create transitions and animations
  • To apply styles based on the device's screen size and features

28. Which CSS property is used to control the transparency of an element, making it partially see-through?

  • `opacity`
  • `visibility`
  • `transparency`
  • `background-opacity`

29. What is the role of the "pseudo-element" in CSS?

  • To create animations and transitions
  • To select elements based on their attribute values
  • To apply styles to a part of an element's content
  • To define custom HTML elements

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

  • `margin`
  • `padding`
  • `border-spacing`
  • `spacing`

31. In CSS, what is the purpose of the "overflow" property?

  • To define the size of an element
  • To create a shadow effect
  • To control the visibility of an element
  • To specify how content overflows an element's box

32. What is the CSS property used to control the indentation of the first line of text within an element?

  • `line-indent`
  • `text-indent`
  • `first-line-indent`
  • `indentation`

33. Which CSS property is used to create rounded corners for an element's box?

  • `border-radius`
  • `box-corners`
  • `corner-radius`
  • `border-rounding`

34. Which CSS property is used to specify the thickness of an element's border?

  • `border-thickness`
  • `border-width`
  • `border-size`
  • `border-strength`

35. What is the role of the "pseudo-class" `.hover` in CSS?

  • It targets the first child element
  • It selects elements based on their attribute values
  • It applies styles when an element is hovered over
  • It defines custom HTML elements

36. In CSS, which property is used to specify the style of an element's border?

  • `border-style`
  • `border-design`
  • `border-appearance`
  • `border-look`

37. What does the "display" property control in CSS?

  • The visibility of an element
  • The size of text
  • The alignment of text
  • How an element is rendered on the page

38. Which CSS property is used to set the text to uppercase or lowercase letters?

  • `text-transform`
  • `font-transform`
  • `case-transform`
  • `text-style`

39. In CSS, what is the purpose of the "position" value "relative"?

  • It removes an element from the document flow
  • It specifies that an element is positioned relative to its normal position
  • It centers an element on the page
  • It hides an element from view

40. What is the CSS property used to set the text to be italic or oblique?

  • `font-style`
  • `text-style`
  • `italicize`
  • `text-italic`

41. Which CSS selector targets the last child element of its parent?

  • `.last-child`
  • `.first-child`
  • `.only-child`
  • `.nth-child`

42. In CSS, what does the "clear" property control?

  • The color of the text
  • The positioning of elements
  • The space between lines of text
  • How floating elements are cleared

43. What does the "visibility" property control in CSS?

  • The display style of an element
  • The font size of text
  • The text color
  • The space between lines of text

44. Which CSS property is used to specify the size of an element's text, relative to the viewport?

  • `font-size`
  • `text-size`
  • `viewport-size`
  • `relative-size`

45. In CSS, what is the purpose of the "text-decoration" property?

  • To control the alignment of text
  • To create animations and transitions
  • To specify the appearance of text decorations such as underlines
  • To change the font of text

46. What is the purpose of the "box-sizing" property in CSS?

  • To change the font style of text
  • To specify the visibility of an element
  • To control the size of a box
  • To define how the total width and height of an element is calculated

47. Which CSS property is used to set the background image of an element?

  • `background-image`
  • `image-url`
  • `background-picture`
  • `image-source`

48. What is the role of the "pseudo-element" `..before` in CSS?

  • To select elements based on their attribute values
  • To create animations and transitions
  • To apply styles before the content of an element
  • To define custom HTML elements

49. Which CSS property is used to control the size of an element's font?

  • `font-size`
  • `text-size`
  • `size`
  • `font-relative`

50. What is the purpose of the "letter-spacing" property in CSS?

  • To control the alignment of text
  • To specify the distance between characters in text
  • To set the text to uppercase or lowercase
  • To change the font style of an element

51. Which CSS property is used to control the thickness of an element's border?

  • `border-thickness`
  • `border-width`
  • `border-size`
  • `border-strength`

52. What is the role of the "pseudo-element" `..after` in CSS?

  • To create animations and transitions
  • To apply styles after the content of an element
  • To define custom HTML elements
  • To select elements based on their attribute values

53. In CSS, what does the "border-collapse" property control?

  • The alignment of text
  • The visibility of an element
  • The spacing between cells in a table
  • The size of the text

54. Which CSS property is used to specify the color of an element's border?

  • `border-color`
  • `border-style`
  • `border-width`
  • `border`

55. What is the purpose of the "font-weight" property in CSS?

  • To set the text to uppercase or lowercase letters
  • To control the size of the text
  • To change the font style of an element
  • To specify the thickness of the font

56. In CSS, what does the "cursor" property control?

  • The size of the text
  • The positioning of elements
  • The visibility of an element
  • The appearance of the mouse cursor when hovering over an element

57. Which CSS property is used to create rounded corners for an element's border?

  • `border-radius`
  • `box-corners`
  • `corner-radius`
  • `border-rounding`

58. What is the purpose of the "word-spacing" property in CSS?

  • To control the alignment of text
  • To specify the distance between words in text
  • To set the text to uppercase or lowercase
  • To change the font style of an element

59. In CSS, what does the "text-align" property control?

  • The size of the text
  • The color of the text
  • The alignment of text within an element
  • The visibility of an element

60. Which CSS property is used to specify the thickness of an element's font characters?

  • `font-strength`
  • `font-width`
  • `font-size`
  • `font-weight`

61. What is the purpose of the "box-shadow" property in CSS?

  • To control the spacing between lines of text
  • To create animations and transitions
  • To apply a shadow effect to an element
  • To change the background color of an element

62. In CSS, what is the purpose of the "visibility" property?

  • To change the font size of text
  • To specify the text color
  • To control the visibility of an element
  • To define the size of an element

63. Which CSS property is used to control the alignment of an element's background image?

  • `background-position`
  • `background-image`
  • `background-align`
  • `background-style`

64. In CSS, what does the "line-height" property control?

  • The size of the text
  • The color of the text
  • The spacing between lines of text
  • The alignment of text

65. What is the role of the "pseudo-class" `.focus` in CSS?

  • To select elements based on their attribute values
  • To create animations and transitions
  • To apply styles when an element is clicked
  • To define custom HTML elements

66. Which CSS property is used to create a dashed or dotted border style for an element?

  • `border-style`
  • `border-design`
  • `border-appearance`
  • `border-look`

67. What is the role of the "pseudo-class" `.nth-child` in CSS?

  • To create animations and transitions
  • To apply styles to elements based on their position within a parent element
  • To define custom HTML elements
  • To select elements based on their attribute values

68. In CSS, what is the purpose of the "text-overflow" property?

  • To control the alignment of text
  • To create animations and transitions
  • To specify how to render text that overflows its container
  • To change the font style of an element

69. Which CSS property is used to specify the distance between the top of an element's content area and the top edge of its border box?

  • `margin-top`
  • `padding-top`
  • `border-top`
  • `top`

70. In CSS, what does the "box-sizing" property value "border-box" indicate?

  • The total width and height of an element includes padding and borders
  • The total width and height of an element includes only the content
  • The total width and height of an element includes margins
  • The total width and height of an element includes padding only

71. What does the "border-radius" property control in CSS?

  • The thickness of an element's border
  • The color of an element's border
  • The alignment of text within an element
  • The rounding of corners on an element's box

72. In CSS, what does the "background-size" property control?

  • The size of an element's text
  • The size of the background image of an element
  • The spacing between lines of text
  • The color of the text

73. Which CSS property is used to specify the size of an element's background image, and how it should be repeated or positioned?

  • `background-image`
  • `background-size`
  • `background-repeat`
  • `background-position`

74. What does the "line-height" property control in CSS?

  • The size of the text
  • The spacing between words in text
  • The spacing between lines of text
  • The color of the text

75. In CSS, what is the purpose of the "outline" property?

  • To create a shadow effect
  • To control the visibility of an element
  • To specify a visible border around an element
  • To create animations and transitions

76. Which CSS property is used to set the text to uppercase letters?

  • `text-transform`
  • `font-transform`
  • `uppercase`
  • `text-style`

77. In CSS, what does the "background-attachment" property control?

  • The positioning of elements
  • The visibility of an element
  • The background image's attachment behavior
  • The thickness of an element's border

78. What does the "opacity" property control in CSS?

  • The thickness of an element's border
  • The visibility of an element
  • The alignment of text
  • The size of the text

79. In CSS, what does the "box-shadow" property value "inset" indicate?

  • The shadow is placed outside the element
  • The shadow is placed inside the element
  • The shadow is not applied
  • The shadow is applied to text

80. Which CSS property is used to specify the thickness of an element's border on its top edge?

  • `border-top-width`
  • `border-width-top`
  • `border-thickness-top`
  • `border-top`

81. What is the purpose of the "box-shadow" property value "none" in CSS?

  • To apply a shadow effect
  • To create animations and transitions
  • To remove the shadow from an element
  • To add an outer shadow to an element

82. Which CSS property is used to control the rendering of an element's background image?

  • `background-image`
  • `background-size`
  • `background-repeat`
  • `background-clip`

83. In CSS, what does the "font-style" property value "italic" indicate?

  • The text is set to uppercase letters
  • The text is set to lowercase letters
  • The text is styled as italics
  • The text is underlined

84. What does the "background-attachment" property value "fixed" indicate in CSS?

  • The background image scrolls with the content
  • The background image is not attached
  • The background image is attached to the element
  • The background image remains fixed as the content scrolls

85. In CSS, what does the "outline" property value "none" indicate?

  • No outline is applied
  • The element is hidden
  • The element has a solid black outline
  • The element has a dashed outline

86. Which CSS property is used to control the space between characters in a text element?

  • `letter-spacing`
  • `word-spacing`
  • `text-spacing`
  • `character-spacing`

87. In CSS, what does the "overflow" property value "hidden" indicate?

  • The element is hidden
  • The element is transparent
  • Content that overflows the element is hidden
  • Content that overflows the element is displayed with scrollbars

88. Which CSS property is used to specify the thickness of an element's border on its right edge?

  • `border-right-width`
  • `border-width-right`
  • `border-thickness-right`
  • `border-right`

89. In CSS, what is the purpose of the "background-origin" property?

  • To control the rendering of an element's background image
  • To specify the distance between lines of text
  • To specify where the background image is positioned
  • To specify the origin of the background positioning area

90. Which CSS property is used to set the text to lowercase letters?

  • `text-transform`
  • `font-transform`
  • `lowercase`
  • `text-style`

91. In CSS, what does the "font-variant" property control?

  • The thickness of an element's font characters
  • The rendering of small caps
  • The visibility of an element
  • The alignment of text

92. What does the "border-collapse" property value "collapse" indicate in CSS?

  • Borders are not applied
  • Borders overlap and are adjacent
  • Borders are separated and don't overlap
  • Borders are collapsed into a single border

93. Which CSS property is used to specify the background color of an element?

  • `background-image`
  • `background-color`
  • `background-style`
  • `background-fill`

94. In CSS, what does the "text-decoration" property value "underline" indicate?

  • Text is styled as italics
  • Text has an underline decoration
  • Text is set to uppercase letters
  • Text is set to lowercase letters

95. What is the purpose of the "z-index" property in CSS?

  • To control the visibility of an element
  • To create animations and transitions
  • To specify the rendering order of positioned elements
  • To change the background color of an element

96. Which CSS property is used to specify the thickness of an element's border on its left edge?

  • `border-left-width`
  • `border-width-left`
  • `border-thickness-left`
  • `border-left`

97. In CSS, what does the "text-align" property value "center" indicate?

  • Text is aligned to the left
  • Text is aligned to the right
  • Text is centered horizontally
  • Text is justified

98. What is the role of the "pseudo-class" `.checked` in CSS?

  • To create animations and transitions
  • To select elements based on their attribute values
  • To apply styles to selected radio buttons and checkboxes
  • To define custom HTML elements

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

  • `line-spacing`
  • `text-line`
  • `line-height`
  • `spacing-line`

100. In CSS, what does the "text-decoration" property value "none" indicate?

  • Text has an underline decoration
  • Text has an overline decoration
  • Text has a line-through decoration
  • No text decorations are applied

Share with : Share on Linkedin Share on Twitter Share on WhatsApp Share on Facebook