HTML and CSS Sample Question
HTML and CSS Sample Question
Part I: HTML
1. What does HTML stand for?
a) Hyperlink Text Markup Language
b) Hyperlink and Text Markup Language
c) Hypertext Markup Language
d) Hypertext and Text Markup Language
9. Which attribute is used to specify an alternate text for an image, if the image cannot be displayed?
a) alt
b) src
c) title
d) caption
10. Which HTML tag is used to define an unordered list?
a) <ul>
b) <ol>
c) <li>
d) <list>
11. What does HTML5 introduce to replace the <div> element in some cases?
a) <section>
b) <divv>
c) <division>
d) <group>
12. Which attribute is used to provide additional information about an element in HTML?
a) info
b) data
c) class
d) extra
17. Which CSS property is used to change the text color of an element?
a) text-color
b) color
c) font-color
d) text-style
19. Which property is used to control the spacing between lines of text?
a) line-height
b) text-spacing
c) font-spacing
d) letter-spacing
20. Which CSS property is used to control the size of text?
a) font-size
b) text-size
c) size
d) text-font
21. What is the default value of the position property in CSS?
a) absolute
b) fixed
c) relative
d) static
24. How do you group multiple selectors to apply the same styles to them in CSS?
a) Separate them with commas
b) Separate them with spaces
c) Separate them with colons
d) Separate them with semicolons
28. Which CSS property is used to control the space between individual letters in text?
a) word-spacing
b) letter-spacing
c) text-spacing
d) font-spacing
HTML
36. What is the purpose of the HTML <meta> tag?
a) To create a clickable link
b) To define metadata about an HTML document
c) To embed videos
d) To display an image
37. Which HTML tag is used for defining an input field for entering numeric values?
a) <input type="number">
b) <input type="text">
c) <input type="numeric">
d) <input type="integer">
38. How can you create a hyperlink that opens in a new tab in HTML?
a) <a href="url" target="_self">Link</a>
b) <a href="url" target="_blank">Link</a>
c) <a href="url" target="_new">Link</a>
d) <a href="url" target="_tab">Link</a>
39. Which HTML tag is used to display computer code?
a) <code>
b) <pre>
c) <var>
d) <kbd>
CSS
43. Which CSS property is used to control the space between elements?
a) margin
b) padding
c) space
d) gap