HTML/CSS MCQs – Multiple Choice Questions and Answers – Part 33
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 type of <input> element allows creating a field to enter a color?
A <input type="text">
B <input type="color">
C <input type="date">
D <input type="range">
2. Which HTML attribute is used to add a descriptive label to a form field?
A label
B for
C description
D input-label
3. Which CSS property controls the duration of a transition?
A transition-duration
B transition-time
C transition-speed
D transition-period
4. Which CSS property is used to define the spacing between the rows of a CSS grid?
A grid-gap
B grid-row-gap
C gap
D grid-spacing
5. Which HTML tag allows you to include a responsive image that adapts to screen size?
A <img src="image.jpg">
B <picture>
C <image srcset="image.jpg">
D <responsive-img src="image.jpg">
6. Which CSS property allows you to add transparency to a color?
A opacity
B color-opacity
C rgba()
D transparent
7. Which HTML tag makes a video responsive (adapts to screen size)?
A <video width="100%">
B <video responsive>
C <iframe>
D <media>
8. Which CSS pseudo-class targets a link after it has been visited by the user?
A :visited
B :active
C :focus
D :hover
9. How do you make a background image responsive with CSS?
A background-size: cover;
B background-size: 100% 100%;
C background-repeat: no-repeat;
D background-image: url('image.jpg');
10. Which HTML tag improves the accessibility of a form?
A <label>
B <fieldset>
C <input>
D <legend>