Q1. What does CSS stand for?
- A.Colorful Style Sheets
- B.Computer Style Sheets
- C.Creative Style System
- D.Cascading Style Sheets✓ Correct
Explanation
CSS stands for Cascading Style Sheets.
Topic in Web Development
CSS (Cascading Style Sheets) is the language used to describe how HTML elements are displayed, controlling layout, colour, typography and spacing. The most tested idea is the cascade: how specificity is calculated for inline styles, IDs, classes and element selectors, how source order and !important break ties, and which properties inherit. The box model is next, with content, padding, border and margin, and how box-sizing: border-box changes width calculations. Expect questions on selector types, pseudo-classes and pseudo-elements, position values (static, relative, absolute, fixed, sticky), display values, z-index, and relative units like em, rem, vh and percentages compared with px.
Below are 30 practice questions from a pool of 210 CSS Fundamentals MCQs, one of 17 topics in Web Development. Each shows the correct answer with an explanation; when you are ready, take a timed quiz to test recall under exam conditions.
Each question below shows the correct answer with a full explanation. Use these to build conceptual understanding before attempting a timed quiz.
Q1. What does CSS stand for?
CSS stands for Cascading Style Sheets.
Q2. Which CSS property changes the text color?
The color property sets the color of text content.
Q3. How do you select an element with the ID 'header' in CSS?
The # selector selects elements by their ID.
Q4. Which CSS property sets the background color?
The background-color property sets the background color of an element.
Q5. How do you select elements with the class 'active' in CSS?
The dot (.) selector selects elements by their class name.
Q6. Which property changes the font size?
The font-size property sets the size of text.
Q7. What is the correct CSS syntax to change font to Arial?
The font-family property specifies the font for text content.
Q8. Which property adds space inside an element's border?
Padding adds space between content and border.
Q9. Which property adds space outside an element's border?
Margin adds space outside an element's border.
Q10. How do you add a comment in CSS?
CSS comments are written between /* and */.
Q11. What is the CSS Box Model?
The CSS Box Model describes how every element is rendered with content, padding, border, and margin.
Q12. What is the difference between display: none and visibility: hidden?
display:none removes the element from layout, while visibility:hidden hides it but preserves space.
Q13. Which CSS property is used to float an element?
The float property positions an element to the left or right.
Q14. What does position: relative do?
position:relative offsets an element from its normal position without removing it from flow.
Q15. What is specificity in CSS?
Specificity determines which CSS rule takes precedence when multiple selectors match.
Q16. Which CSS pseudo-class applies when the user hovers over an element?
The :hover pseudo-class applies styles when the pointer hovers over an element.
Q17. What is the z-index property used for?
z-index controls the vertical stacking order of positioned elements.
Q18. What does box-sizing: border-box do?
border-box includes padding and border within the specified width and height.
Q19. Which selector targets the first child element?
The :first-child pseudo-class selects an element that is the first child of its parent.
Q20. What is the inherit value in CSS?
inherit forces a property to take the computed value from its parent element.
Q21. What is the difference between em and rem units?
em is relative to the parent element's font size, while rem is relative to the root element's font size.
Q22. What are CSS custom properties (variables)?
CSS custom properties are declared with -- and accessed using var().
Q23. What is the will-change CSS property?
will-change informs the browser about expected changes for rendering optimization.
Q24. How does the CSS calc() function work?
calc() allows mixing units in mathematical expressions for dynamic sizing.
Q25. What is the stacking context in CSS?
A stacking context determines the rendering order of elements along the z-axis.
Q26. What does the @supports rule do in CSS?
@supports applies CSS rules only if the browser supports the specified property and value.
Q27. What is the difference between :nth-child() and :nth-of-type()?
:nth-child() counts among all siblings, while :nth-of-type() counts only siblings of the same element type.
Q28. What is a CSS combinator?
Combinators define the relationship between selectors in CSS.
Q29. What is the contain property in CSS?
The contain property isolates an element's subtree from the document for rendering optimization.
Q30. What is the CSS clamp() function?
clamp(min, preferred, max) constrains a value between a minimum and maximum.
Practice MCQs with explanations
Practice MCQs with explanations
Practice MCQs with explanations
Practice MCQs with explanations
Practice MCQs with explanations
Practice MCQs with explanations
Take a timed quiz drawn from 210+ questions on this topic. No signup required — your progress saves in your browser.
Start CSS Fundamentals Quiz