HTML/CSS MCQs – Multiple Choice Questions and Answers – Part 17
Multiple choice questions and answers (MCQs) on HTML/CSS to prepare for exams, tests, and certifications. These questions are taken from a real written exam and some parts are taken from an interview. So you will find questions on basic techniques such as tags, web standards, CSS selector, objects, and more. This quiz will easily prepare anyone to pass their online test.
1. What element defines the main structure of an HTML page?
A <html>
B <head>
C <body>
D <header>
2. Which HTML tag is used to include a description in the source code of the page that is used by search engines?
A <meta>
B <title>
C <description>
D <keywords>
3. Which CSS pseudo-class targets a link when it is hovered by the mouse?
A :active
B :focus
C :hover
D :visited
4. Which HTML tag is used to define a footer in a document?
A <footer>
B <div>
C <section>
D <footer-section>
5. Which HTML tag is used to create a button in a form?
A <input type="button">
B <button>
C <input type="submit">
D All of the above
6. Which HTML tag is used to define the character encoding of a page?
A <meta charset="UTF-8">
B <meta>
C <title>
D <link>
7. Which CSS property allows you to position an element relative to its container?
A position: absolute;
B position: fixed;
C position: relative;
D position: sticky;
8. Which CSS property is used to change the thickness of text?
A font-weight
B font-style
C text-align
D font-family
9. Which CSS property is used to add space outside of an element?
A padding
B margin
C spacing
D border-spacing
10. Which CSS property defines the alignment of items along the cross axis in a Flexbox container?
A justify-content
B align-items
C flex-wrap
D align-self