Modern CSS interview questions

21 Modern CSS questions from the CSS bank, written for Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd.

Sign up free to see every answer with its explanation and ask the AI tutor.

Practice Modern CSS free

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

Answer + AI explanation with a 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

Answer + AI explanation with a 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

Answer + AI explanation with a 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

Answer + AI explanation with a free account

5. Which term means: "reusable variables defined with a double-hyphen prefix and read through the var() function"?

Mid
  1. A.:has() pseudo-class
  2. B.subgrid
  3. C.clamp() function
  4. D.custom properties

Answer + AI explanation with a 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

Answer + AI explanation with a 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

Answer + AI explanation with a free account

8. Which term means: "a function returning a value bounded between a minimum and maximum while scaling with a preferred middle value"?

Senior
  1. A.subgrid
  2. B.cascade layers
  3. C.clamp() function
  4. D.container queries

Answer + AI explanation with a 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

Answer + AI explanation with a 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

Answer + AI explanation with a 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

Answer + AI explanation with a 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

Answer + AI explanation with a 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

Answer + AI explanation with a free account

14. Which term means: "a value letting a nested grid inherit the track sizing of its parent grid"?

Senior
  1. A.subgrid
  2. B.custom properties
  3. C.aspect-ratio property
  4. D.:has() pseudo-class

Answer + AI explanation with a 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

Answer + AI explanation with a 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

Answer + AI explanation with a 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

Answer + AI explanation with a 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

Answer + AI explanation with a 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

Answer + AI explanation with a free account

20. Which term means: "a property that sizes a box to a fixed width-to-height proportion automatically"?

Mid
  1. A.custom properties
  2. B.container queries
  3. C.aspect-ratio property
  4. D.clamp() function

Answer + AI explanation with a 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

Answer + AI explanation with a free account

Free to start

Answers, AI explanations, and a free readiness check

Sign up free to check your answers with explanations, ask the AI tutor anything on any question, and take the free 2-minute readiness check for a scored result. One full AI mock interview, scored like a real panel, is free when you sign up.

Practice Modern CSS free
24,000+ questions & coding problemsSoftware & IT16,274 questionsGovernment jobs26 examsAptitudenew questions every timeAI practice interviewwith feedback65 topics to practiseMechanical1,149 questionsGATE ME9 papersEngineering Mathematics381 questions2-minute checkfreeDSA Problems1,422Civil1,005 questionsGATE CE9 papersCS Fundamentals1,209 questionsYour scores6 skillsSystem Design25Electrical / EEE1,047 questionsGATE EE9 papersRun your codeC++ · Java · PythonLow-Level Design144Electronics & Comm.975 questionsGATE EC9 papersAI help on every questionFull-Stack6,282Chemical1,005 questionsGATE CH9 papersAI whiteboardsystem designWork abroadEurope · remote · transfersESE ME1 paperGATE practice papers2019–2026ESE CE1 paperDate alertsbefore the last dateESE EE1 paperBehavioural courseHR round practiceESE ET1 paperResume optimizerProSSC JE ME1 paperApplication trackerSSC JE CE1 paperCompany-wise prepSSC JE EE1 paperRole roadmapsRRB JE1 subjectPriced in ₹UPI · cardsISRO SC1 paperGATE CS9 papersIBPS SO IT1 paperUGC NET CS1 paperSSC CGL26 papersIBPS PO26 papersRRB NTPC26 papersSSC CHSL26 papersIBPS Clerk26 papersSBI Clerk26 papersRRB Group D26 papersSSC CPO26 papersSSC GD26 papers