Skip to main content
InterviewHubPRO
Section Overview
Q40

Question 40 of 50

Part 3: Advanced Internals, Scale & Production Architecture (Senior / Lead)

80%
CSS3 & Modern Layouts (50 Qs)•Part 3: Advanced Internals, Scale & Production Architecture (Senior / Lead)

Native CSS Nesting without Preprocessors.

senior LevelCode ExampleSystem Design

In Simple Words: Modern browsers natively support nested CSS rules without requiring Sass, Less, or PostCSS:

  • Use the & nesting selector to reference parent selectors or pseudo-classes (&:hover).
  • Can nest element tags and media queries directly inside selectors.
css
.card {
  background: white;
  padding: 1.5rem;

  &:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  }

  & .title {
    font-size: 1.25rem;
    color: #1e293b;
  }

  @media (max-width: 640px) {
    padding: 1rem;
  }
}