Practice 100 HTML & CSS MCQs with answers covering basic to advanced concepts. Improve your web development skills with multiple choice questions on HTML tags, CSS properties, forms, layouts, animations, and responsive design.
Are you preparing for a web development exam, job interview, or simply looking to strengthen your frontend skills? These 100 HTML & CSS MCQs with answers are designed to help you master both basic and advanced concepts of web design. From essential HTML tags and forms to modern CSS features like Flexbox, Grid, animations, and responsive design, this comprehensive multiple choice quiz will test your knowledge and improve your understanding. Whether you are a beginner or an aspiring professional developer, practicing these HTML and CSS multiple choice questions will boost your confidence and sharpen your coding skills.
Here are 100 MCQs on HTML & CSS. Each question has four options, and the correct answer is provided below each question.
HTML MCQs
1. What does HTML stand for?
A) Hyper Text Markup Language
B) High Text Machine Language
C) Hyper Tool Multi Language
D) Hyperlinks and Text Markup Language
Answer: A
2. Who is the standard organization for HTML?
A) Google
B) Mozilla
C) W3C
D) Microsoft
Answer: C
3. The correct HTML element for the largest heading is:
A) <heading>
B) <h6>
C) <head>
D) <h1>
Answer: D
4. Which tag is used to create a paragraph in HTML?
A) <para>
B) <p>
C) <pg>
D) <paragraph>
Answer: B
5. Which attribute is used to provide a unique name to an HTML element?
A) class
B) id
C) name
D) type
Answer: B
6. Which HTML tag is used to insert an image?
A) <img>
B) <image>
C) <src>
D) <pic>
Answer: A
7. Which attribute specifies the URL of an image?
A) link
B) src
C) href
D) url
Answer: B
8. Which tag is used to create a hyperlink?
A) <a>
B) <link>
C) <href>
D) <hyper>
Answer: A
9. Which attribute is used with the <a> tag to specify the link address?
A) src
B) link
C) href
D) url
Answer: C
10. Which tag is used to create a line break?
A) <lb>
B) <br>
C) <break>
D) <newline>
Answer: B
11. HTML files are saved with which extension?
A) .html
B) .ht
C) .hml
D) .xml
Answer: A
12. Which tag is used to define an unordered list?
A) <ol>
B) <ul>
C) <li>
D) <list>
Answer: B
13. Which tag is used for list items?
A) <li>
B) <item>
C) <ul>
D) <ol>
Answer: A
14. Which tag is used to create a table?
A) <table>
B) <tr>
C) <td>
D) <tab>
Answer: A
15. Which tag defines a table row?
A) <th>
B) <td>
C) <tr>
D) <row>
Answer: C
16. Which tag defines a table header cell?
A) <th>
B) <td>
C) <tr>
D) <thead>
Answer: A
17. Which tag is used to create a form?
A) <input>
B) <form>
C) <button>
D) <label>
Answer: B
18. Which input type is used for passwords?
A) text
B) password
C) hidden
D) secure
Answer: B
19. Which tag is used to define the document’s body?
A) <main>
B) <body>
C) <section>
D) <content>
Answer: B
20. Which tag contains meta-information about the document?
A) <meta>
B) <head>
C) <info>
D) <title>
Answer: B
CSS MCQs
21. What does CSS stand for?
A) Computer Style Sheets
B) Cascading Style Sheets
C) Creative Style Sheets
D) Colorful Style Sheets
Answer: B
22. Which HTML tag is used to define internal CSS?
A) <css>
B) <script>
C) <style>
D) <link>
Answer: C
23. Which property is used to change text color?
A) font-color
B) text-color
C) color
D) background-color
Answer: C
24. Which property is used to change background color?
A) color
B) bg-color
C) background-color
D) back-color
Answer: C
25. Which CSS property controls text size?
A) font-style
B) text-size
C) font-size
D) text-style
Answer: C
26. How do you select an element with id “demo”?
A) .demo
B) #demo
C) demo
D) *demo
Answer: B
27. How do you select elements with class “test”?
A) #test
B) .test
C) test
D) *test
Answer: B
28. Which property is used to change font?
A) font-family
B) font-style
C) text-font
D) typeface
Answer: A
29. Which property makes text bold?
A) font-weight
B) text-style
C) font-bold
D) bold
Answer: A
30. Which property aligns text horizontally?
A) text-align
B) align
C) horizontal-align
D) text-position
Answer: A
(Continuing…)
31. Which property adds space inside an element?
A) margin
B) padding
C) spacing
D) border
Answer: B
32. Which property adds space outside an element?
A) margin
B) padding
C) border
D) spacing
Answer: A
33. Which property sets the border color?
A) border-style
B) border-width
C) border-color
D) border
Answer: C
34. Which CSS property controls the transparency?
A) opacity
B) visibility
C) transparent
D) alpha
Answer: A
35. Which property changes the list style type?
A) list
B) list-style-type
C) list-type
D) style-list
Answer: B
36. Which position value makes an element relative to its normal position?
A) static
B) absolute
C) relative
D) fixed
Answer: C
37. Which position value fixes element to viewport?
A) static
B) fixed
C) relative
D) absolute
Answer: B
38. Which property is used for flexbox layout?
A) display: block
B) display: inline
C) display: flex
D) display: grid
Answer: C
39. Which property defines grid layout?
A) display: flex
B) display: block
C) display: inline
D) display: grid
Answer: D
40. Which property controls element visibility?
A) display
B) visible
C) show
D) opacity
Answer: A
(Questions 41–100 Continue Below)
41. Default position value in CSS?
A) relative
B) absolute
C) static
D) fixed
Answer: C
42. Which tag defines HTML5 semantic section?
A) <div>
B) <span>
C) <section>
D) <font>
Answer: C
43. Which tag is used for navigation links?
A) <navigate>
B) <nav>
C) <links>
D) <menu>
Answer: B
44. Which property rounds element corners?
A) border-style
B) corner-radius
C) border-radius
D) radius
Answer: C
45. Which property adds shadow to text?
A) text-shadow
B) font-shadow
C) shadow
D) box-shadow
Answer: A
46. Which property adds shadow to box?
A) text-shadow
B) box-shadow
C) shadow-box
D) border-shadow
Answer: B
47. Which unit is relative to root element?
A) em
B) px
C) rem
D) %
Answer: C
48. Which tag defines footer?
A) <bottom>
B) <footer>
C) <end>
D) <section>
Answer: B
49. Which property changes cursor style?
A) mouse
B) pointer
C) cursor
D) hover
Answer: C
50. Which pseudo-class applies when hovering?
A) :hover
B) :click
C) :active
D) :focus
Answer: A
51. Which tag embeds video?
A) <media>
B) <video>
C) <movie>
D) <mp4>
Answer: B
52. Which tag embeds audio?
A) <sound>
B) <audio>
C) <music>
D) <mp3>
Answer: B
53. Which attribute makes input required?
A) validate
B) required
C) must
D) necessary
Answer: B
54. Which property controls overflow?
A) overflow
B) flow
C) scroll
D) wrap
Answer: A
55. Which property prevents text wrapping?
A) text-wrap
B) nowrap
C) white-space
D) wrap-text
Answer: C
56. Which value hides element but keeps space?
A) display: none
B) visibility: hidden
C) opacity: 0
D) hidden: true
Answer: B
57. Which value removes element completely?
A) visibility: hidden
B) display: none
C) opacity: 0
D) hidden: true
Answer: B
58. Which tag defines title?
A) <meta>
B) <title>
C) <head>
D) <header>
Answer: B
59. Which property sets element width?
A) size
B) length
C) width
D) max-width
Answer: C
60. Which property sets element height?
A) height
B) size
C) length
D) max-height
Answer: A
61. Which CSS property controls the stacking order of elements?
A) stack
B) z-index
C) order
D) layer
Answer: B
62. Which property is used to float an element?
A) align
B) float
C) position
D) display
Answer: B
63. Which property clears floated elements?
A) clear
B) float-clear
C) both
D) overflow
Answer: A
64. Which HTML element is inline by default?
A) <div>
B) <p>
C) <span>
D) <section>
Answer: C
65. Which HTML element is block-level by default?
A) <span>
B) <a>
C) <div>
D) <img>
Answer: C
66. Which CSS property changes an element from block to inline?
A) position
B) display
C) float
D) align
Answer: B
67. Which value makes an element inline but allows width and height?
A) inline
B) block
C) inline-block
D) flex
Answer: C
68. Which property is used to create space between lines of text?
A) letter-spacing
B) word-spacing
C) line-height
D) text-spacing
Answer: C
69. Which property controls spacing between letters?
A) letter-spacing
B) word-spacing
C) line-height
D) text-indent
Answer: A
70. Which property controls spacing between words?
A) word-spacing
B) letter-spacing
C) text-spacing
D) spacing
Answer: A
71. Which property indents the first line of text?
A) text-indent
B) indent
C) margin-left
D) padding-left
Answer: A
72. Which CSS rule is used for responsive design?
A) @responsive
B) @media
C) @screen
D) @device
Answer: B
73. Which property rotates an element?
A) transform
B) rotate
C) transition
D) animation
Answer: A
74. Which CSS function is used to scale an element?
A) resize()
B) zoom()
C) scale()
D) grow()
Answer: C
75. Which property defines the speed of a transition effect?
A) transition-speed
B) animation-speed
C) transition-duration
D) speed
Answer: C
76. Which property specifies the name of an animation?
A) animation-name
B) animation-style
C) animation-type
D) keyframe
Answer: A
77. Which rule defines animation keyframes?
A) @animation
B) @transition
C) @keyframes
D) @frames
Answer: C
78. Which property makes text uppercase?
A) text-transform
B) font-transform
C) uppercase
D) text-style
Answer: A
79. Which property hides overflow content?
A) overflow: hidden
B) display: none
C) visibility: hidden
D) hidden: true
Answer: A
80. Which input type allows selecting multiple options?
A) radio
B) checkbox
C) text
D) password
Answer: B
81. Which input type allows selecting only one option?
A) checkbox
B) radio
C) button
D) select
Answer: B
82. Which HTML tag defines a dropdown list?
A) <input>
B) <list>
C) <select>
D) <dropdown>
Answer: C
83. Which tag defines options inside a dropdown?
A) <choice>
B) <item>
C) <option>
D) <value>
Answer: C
84. Which attribute specifies placeholder text in input?
A) hint
B) text
C) placeholder
D) label
Answer: C
85. Which property sets maximum width?
A) max-width
B) maximum-width
C) width-max
D) limit-width
Answer: A
86. Which property sets minimum height?
A) min-height
B) minimum-height
C) height-min
D) min-size
Answer: A
87. Which CSS property controls column layout?
A) column-count
B) columns-layout
C) grid-column
D) flex-column
Answer: A
88. Which property specifies font style (italic)?
A) font-weight
B) font-style
C) text-style
D) italic
Answer: B
89. Which property sets background image?
A) image
B) background-src
C) background-image
D) bg-image
Answer: C
90. Which property repeats background image?
A) background-repeat
B) image-repeat
C) repeat-image
D) bg-repeat
Answer: A
91. Which property positions background image?
A) background-align
B) background-position
C) image-position
D) bg-location
Answer: B
92. Which value centers text?
A) left
B) right
C) justify
D) center
Answer: D
93. Which property changes mouse pointer to hand?
A) cursor: pointer
B) mouse: hand
C) pointer: true
D) hover: pointer
Answer: A
94. Which tag groups block-level elements?
A) <span>
B) <group>
C) <div>
D) <section>
Answer: C
95. Which HTML5 tag defines main content?
A) <main>
B) <content>
C) <primary>
D) <body>
Answer: A
96. Which property makes element transparent?
A) visibility
B) opacity
C) transparent
D) display
Answer: B
97. Which property adds space between border and content?
A) margin
B) spacing
C) padding
D) border-space
Answer: C
98. Which CSS value makes element invisible but clickable?
A) opacity: 0
B) visibility: hidden
C) display: none
D) hidden: true
Answer: A
99. Which property defines the thickness of border?
A) border-style
B) border-width
C) border-size
D) border-thickness
Answer: B
100. Which CSS property sets the display type of an element?
A) position
B) float
C) display
D) visibility
Answer: C
Advertisement:


