HTML/CSS MCQs – Multiple Choice Questions and Answers – Part 27
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. How do you create a container with a semi-transparent background while keeping its content readable?
A background-color: rgba(255, 0, 0, 0.5);
B background-opacity: 0.5;
C background-color: transparent;
D background-image: transparent;
2. Which CSS property creates a zoom effect on an image when a user hovers over it?
A transform: scale(1.2);
B zoom: 1.2;
C transform: zoom(1.2);
D scale: 1.2;
3. How can you give a webpage a dynamic background that moves slowly across the page?
A background-image: linear-gradient;
B background-attachment: fixed;
C background-position: fixed;
D background-size: cover;
4. What is the role of the CSS Flexbox model?
A Create a layout grid
B Create a flexible and dynamic layout
C Resize elements
D Arrange items in a table
5. If you want to create a text animation that reveals letters one by one, which type of animation should you use?
A @keyframes
B text-appear
C @animate-text
D @sequence
6. Which CSS property helps render an image sharper on high-resolution screens like Retina displays?
A image-smoothing
B image-resolution
C image-rendering
D background-image-resolution
7. You want to show a table with borders between cells but no outer border around the entire table. Which CSS property should you use?
A border-collapse: separate;
B border-collapse: collapse;
C border-style: none;
D border: 1px solid transparent;
8. Which CSS property turns an HTML element into a flexible container that wraps its items onto multiple lines if needed?
A flex-wrap: wrap;
B flex-direction: column;
C justify-content: space-evenly;
D align-items: center;
9. You want your page to have a sticky header that remains visible while scrolling. Which CSS property do you use?
A position: fixed;
B position: sticky; top: 0;
C position: absolute;
D position: relative;
10. You want to apply a blur effect to an image on hover without changing its size. Which CSS property do you use?
A filter: blur(5px);
B filter: opacity(0.5);
C transform: scale(1.1);
D background-blur: 5px;