HTML/CSS MCQs – Multiple Choice Questions and Answers – Part 44
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. What effect does the CSS property backdrop-filter: blur(5px);
produce?
A Blurs the background behind an element
B Adds a blurred drop shadow
C Creates a blurred gradient background
D Blurs the text of an element
2. Which CSS property lets you ensure that text inside an element wraps to fit without overflowing?
A word-wrap: break-word;
B white-space: nowrap;
C text-overflow: ellipsis;
D overflow-wrap: break-word;
3. Which CSS property creates a text highlight effect on hover?
A background-color: yellow; color: black;
B color: yellow; background-color: black;
C text-decoration: underline; background-color: yellow;
D text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2); color: #ff6347;
4. What effect does @keyframes swing
create, which moves an element from 0 to 20 degrees and back to 0?
A A swinging motion
B A vertical translation
C A circular motion
D A zoom effect
5. Which CSS property can be used to create a 3D text effect?
A text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
B transform: perspective(500px) rotateX(10deg);
C font-weight: bold; text-transform: uppercase;
D box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.3);
6. What does the CSS property border-image
do?
A Applies an image as a border around an element.
B Sets a border of a specific color.
C Adds a gradient border around an element.
D Creates an animated border that changes color.
7. Which CSS layout model allows you to arrange elements in a two-dimensional grid?
A Flexbox
B Grid
C Block
D Inline
8. Where is it best to place a JavaScript file in an HTML document so it doesn’t block page rendering?
A Inside the <head> section
B Before the </body> tag
C At the start of the <body> tag
D Inside the <footer> section
9. Which CSS property sets the thickness of an element’s border?
A border-width
B border-thickness
C border-style
D border-size
10. Which CSS selector targets all <p> elements that follow a <div>, regardless of whether they come immediately after?
A div + p
B div ~ p
C div > p
D div p