HTML/CSS MCQs – Multiple Choice Questions and Answers – Part 23
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 property defines a grid layout?
A display: grid;
B display: inline-block;
C display: flex;
D grid-layout: true;
2. Which CSS function is used to create a radial gradient?
A linear-gradient()
B radial-gradient()
C gradient-radial()
D circle-gradient()
3. Which HTML tag is used to include a quote in a web page?
A <quote>
B <q>
C <cite>
D <blockquote>
4. Which HTML tag allows you to add a responsive image that adapts to the size of its container?
A <img src="image.jpg">
B <img src="image.jpg" width="100%">
C <picture><source srcset="image.jpg"><img src="image.jpg"></picture>
D <img src="image.jpg" style="width: 100%;">
5. What is the effect of the following CSS rule on a Flexbox container?
.container { display: flex; justify-content: center; align-items: center; }
A Items align to the top-left corner
B Items are centered both horizontally and vertically
C Items are stacked on top of each other
D Items align to the right only
6. In a Flexbox container, what does the flex-wrap: wrap
property do?
A Forces all items onto a single line
B Forces items into one line regardless of size
C Allows items to wrap onto multiple lines if needed
D Centers items on the line
7. What is the difference between a relative and an absolute link in HTML?
A A relative link uses a full URL, while an absolute link uses a relative path
B A relative link is based on the current page’s location, while an absolute link uses a full URL
C A relative link is always shorter than an absolute link
D There is no difference between the two types of links
8. Which CSS property is used to rotate an element?
A transform: rotate()
B rotate: transform()
C transform: rotateX()
D transform: angle()
9. What behavior does the flex-grow
property apply in a Flexbox container?
A It controls spacing between items
B It defines the width of each item
C It allows items to grow and fill the available space
D It adjusts item size based on content
10. What is the effect of the following CSS rule on an element?
.element { position: fixed; top: 0; left: 0; }
A The element is absolutely positioned relative to its parent
B The element is placed at the top-left of the page and remains visible during scrolling
C The element is centered on the page
D The element is placed at the bottom-right of the page