HTML/CSS MCQs – Multiple Choice Questions and Answers – Part 15
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 CSS unit is relative to the font size of the parent element?
A em
B px
C rem
D pt
2. Which CSS property is used to move an element based on its relative positioning?
A left, top
B transform
C translate
D position
3. Which CSS property is used to change the color of an unvisited link?
A a:visited
B a:link
C a:hover
D a:focus
4. Which CSS property sets the duration of an animation?
A animation-duration
B animation-time
C transition-duration
D animation-delay
5. Which HTML tag is used to create a table row?
A <td>
B <tr>
C <th>
D <table>
6. Which CSS property makes a container flexible?
A flexbox
B display: flex;
C flex: auto;
D container-flex;
7. Which CSS property horizontally centers an element inside a flex container?
A align-items: center;
B justify-content: center;
C text-align: center;
D margin: auto;
8. Which CSS property creates a smooth transition when an element changes state?
A transition
B animation
C transform
D move
9. Which attribute is used in the <input> tag to define the field type (such as text, password, button, etc.)?
A type
B field
C value
D name
10. Which CSS property defines the space between lines of text?
A line-height
B letter-spacing
C text-align
D text-spacing