HTML/CSS MCQs – Multiple Choice Questions and Answers – Part 13
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. Which HTML tag is used to create a link?
A <button>
B <a>
C <link>
D <nav>
2. Which attribute is used to add an image to an HTML page?
A src
B alt
C href
D image
3. Which CSS property is used to change the text color?
A background-color
B color
C font-size
D text-color
4. Which CSS selector targets all <p> elements on an HTML page?
A p {}
B .p {}
C #p {}
D *p {}
5. Which CSS property is used to align items inside a flexbox container?
A align-items
B justify-content
C align-content
D All of the above
6. Which property is used to make a website responsive based on screen size?
A media-query
B @media
C responsive
D viewport
7. Which HTML tag is used to create a text field in a form?
A <input type="text">
B <textarea>
C <input type="password">
D <input type="button">
8. Which CSS property allows an element to be horizontally centered within its parent?
A position: center;
B text-align: center;
C margin: 0 auto;
D align-items: center;
9. Which CSS property sets the spacing between elements in a flex container?
A justify-content
B flex-gap
C align-items
D margin
10. Which CSS property is used to underline links?
Example: Welcome To StackHowTo!
A text-decoration: underline;
B link-decoration: underline;
C decoration: underline;
D underline: true;