Modern CSS interview questions

21 real Modern CSS questions from the CSS bank, as asked in Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd — free to start.

1. What is :has() pseudo-class?

Senior
  1. A.a property that sizes a box to a fixed width-to-height proportion automatically
  2. B.reusable variables defined with a double-hyphen prefix and read through the var() function
  3. C.a value letting a nested grid inherit the track sizing of its parent grid
  4. D.a relational selector that styles an element based on the descendants or siblings it contains, often called the parent selector
Reveal the answer + AI explanation — free account

2. Which term means: "a relational selector that styles an element based on the descendants or siblings it contains, often called the parent selector"?

Senior
  1. A.container queries
  2. B.:has() pseudo-class
  3. C.custom properties
  4. D.subgrid
Reveal the answer + AI explanation — free account

3. Which statement is correct?

Senior
  1. A.:has() pseudo-class — a function returning a value bounded between a minimum and maximum while scaling with a preferred middle value
  2. B.:has() pseudo-class — an at-rule mechanism that groups rules into ordered priority tiers independent of selector specificity
  3. C.:has() pseudo-class — reusable variables defined with a double-hyphen prefix and read through the var() function
  4. D.:has() pseudo-class — a relational selector that styles an element based on the descendants or siblings it contains, often called the parent selector
Reveal the answer + AI explanation — free account

4. What is custom properties?

Mid
  1. A.a value letting a nested grid inherit the track sizing of its parent grid
  2. B.rules that style elements based on the size of their nearest containment ancestor rather than the viewport
  3. C.an at-rule mechanism that groups rules into ordered priority tiers independent of selector specificity
  4. D.reusable variables defined with a double-hyphen prefix and read through the var() function
Reveal the answer + AI explanation — free account

6. Which statement is correct?

Mid
  1. A.custom properties — a function returning a value bounded between a minimum and maximum while scaling with a preferred middle value
  2. B.custom properties — rules that style elements based on the size of their nearest containment ancestor rather than the viewport
  3. C.custom properties — a property that sizes a box to a fixed width-to-height proportion automatically
  4. D.custom properties — reusable variables defined with a double-hyphen prefix and read through the var() function
Reveal the answer + AI explanation — free account

7. What is clamp() function?

Senior
  1. A.a property that sizes a box to a fixed width-to-height proportion automatically
  2. B.reusable variables defined with a double-hyphen prefix and read through the var() function
  3. C.an at-rule mechanism that groups rules into ordered priority tiers independent of selector specificity
  4. D.a function returning a value bounded between a minimum and maximum while scaling with a preferred middle value
Reveal the answer + AI explanation — free account

9. Which statement is correct?

Senior
  1. A.clamp() function — a function returning a value bounded between a minimum and maximum while scaling with a preferred middle value
  2. B.clamp() function — rules that style elements based on the size of their nearest containment ancestor rather than the viewport
  3. C.clamp() function — a value letting a nested grid inherit the track sizing of its parent grid
  4. D.clamp() function — an at-rule mechanism that groups rules into ordered priority tiers independent of selector specificity
Reveal the answer + AI explanation — free account

10. What is container queries?

Senior
  1. A.a relational selector that styles an element based on the descendants or siblings it contains, often called the parent selector
  2. B.a value letting a nested grid inherit the track sizing of its parent grid
  3. C.rules that style elements based on the size of their nearest containment ancestor rather than the viewport
  4. D.an at-rule mechanism that groups rules into ordered priority tiers independent of selector specificity
Reveal the answer + AI explanation — free account

11. Which term means: "rules that style elements based on the size of their nearest containment ancestor rather than the viewport"?

Senior
  1. A.container queries
  2. B.aspect-ratio property
  3. C.cascade layers
  4. D.:has() pseudo-class
Reveal the answer + AI explanation — free account

12. Which statement is correct?

Senior
  1. A.container queries — rules that style elements based on the size of their nearest containment ancestor rather than the viewport
  2. B.container queries — a function returning a value bounded between a minimum and maximum while scaling with a preferred middle value
  3. C.container queries — a relational selector that styles an element based on the descendants or siblings it contains, often called the parent selector
  4. D.container queries — an at-rule mechanism that groups rules into ordered priority tiers independent of selector specificity
Reveal the answer + AI explanation — free account

13. What is subgrid?

Senior
  1. A.an at-rule mechanism that groups rules into ordered priority tiers independent of selector specificity
  2. B.rules that style elements based on the size of their nearest containment ancestor rather than the viewport
  3. C.a value letting a nested grid inherit the track sizing of its parent grid
  4. D.a function returning a value bounded between a minimum and maximum while scaling with a preferred middle value
Reveal the answer + AI explanation — free account

15. Which statement is correct?

Senior
  1. A.subgrid — a relational selector that styles an element based on the descendants or siblings it contains, often called the parent selector
  2. B.subgrid — a value letting a nested grid inherit the track sizing of its parent grid
  3. C.subgrid — a property that sizes a box to a fixed width-to-height proportion automatically
  4. D.subgrid — reusable variables defined with a double-hyphen prefix and read through the var() function
Reveal the answer + AI explanation — free account

16. What is cascade layers?

Senior
  1. A.an at-rule mechanism that groups rules into ordered priority tiers independent of selector specificity
  2. B.a property that sizes a box to a fixed width-to-height proportion automatically
  3. C.a relational selector that styles an element based on the descendants or siblings it contains, often called the parent selector
  4. D.rules that style elements based on the size of their nearest containment ancestor rather than the viewport
Reveal the answer + AI explanation — free account

17. Which term means: "an at-rule mechanism that groups rules into ordered priority tiers independent of selector specificity"?

Senior
  1. A.clamp() function
  2. B.aspect-ratio property
  3. C.cascade layers
  4. D.container queries
Reveal the answer + AI explanation — free account

18. Which statement is correct?

Senior
  1. A.cascade layers — a property that sizes a box to a fixed width-to-height proportion automatically
  2. B.cascade layers — a value letting a nested grid inherit the track sizing of its parent grid
  3. C.cascade layers — an at-rule mechanism that groups rules into ordered priority tiers independent of selector specificity
  4. D.cascade layers — rules that style elements based on the size of their nearest containment ancestor rather than the viewport
Reveal the answer + AI explanation — free account

19. What is aspect-ratio property?

Mid
  1. A.a property that sizes a box to a fixed width-to-height proportion automatically
  2. B.a value letting a nested grid inherit the track sizing of its parent grid
  3. C.reusable variables defined with a double-hyphen prefix and read through the var() function
  4. D.an at-rule mechanism that groups rules into ordered priority tiers independent of selector specificity
Reveal the answer + AI explanation — free account

21. Which statement is correct?

Mid
  1. A.aspect-ratio property — rules that style elements based on the size of their nearest containment ancestor rather than the viewport
  2. B.aspect-ratio property — a property that sizes a box to a fixed width-to-height proportion automatically
  3. C.aspect-ratio property — a relational selector that styles an element based on the descendants or siblings it contains, often called the parent selector
  4. D.aspect-ratio property — a function returning a value bounded between a minimum and maximum while scaling with a preferred middle value
Reveal the answer + AI explanation — free account

Free to start

Answers, AI explanations, and a scored voice mock interview

Sign up free to check your answers with explanations, ask the AI tutor anything on any question, and take one full AI mock interview — scored like a real panel.

Practice Modern CSS free