LearnThatStack Ace your next interview
Frontend Development
CSS3.
104 Qs 15 free
Change topic Change
Drill · questions

All questions

of 104
Beginner 17
01

Explain the CSS cascade and specificity

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

The CSS cascade determines which styles apply when multiple rules target the same element. Specificity is calculated as:

  1. Inline styles (1000 points)
  2. IDs (100 points each)
  3. Classes, attributes, pseudo-classes (10 points each)
  4. Elements and pseudo-elements (1 point each)

When specificity is equal, the last rule in source order wins. !important overrides specificity but should be used sparingly.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

02

What is the difference between `display: none` and `visibility: hidden`?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain
  • display: none: Completely removes the element from the document flow. The element takes up no space and doesn't affect layout.
  • visibility: hidden: Hides the element but preserves its space in the layout. The element remains in the document flow but is invisible.
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

03

Explain the difference between `margin` and `padding`

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain
  • Margin: Space outside the element's border, creating distance between elements. Margins can collapse vertically.
  • Padding: Space inside the element's border, between the border and content. Padding increases the element's total size.
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

04

Explain the different types of CSS selectors

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain
  • Element Selector: div - targets all div elements
  • Class Selector: .classname - targets elements with specific class
  • ID Selector: #idname - targets element with specific ID
  • Attribute Selector: [type="text"] - targets elements with specific attributes
  • Pseudo-class: :hover - targets elements in specific states
  • Pseudo-element: ::before - targets specific parts of elements
  • Descendant: div p - targets p elements inside div
  • Child: div > p - targets direct p children of div
  • Adjacent Sibling: h2 + p - targets p immediately after h2
  • General Sibling: h2 ~ p - targets all p siblings after h2
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

05

How does the universal selector (*) work and when should you use it?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

The universal selector * matches all elements. Common uses:

/* Reset all margins and padding */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Target all children */
.container * {
  font-family: Arial, sans-serif;
}

Use sparingly as it can impact performance and may override more specific styles unintentionally.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

06

Explain the CSS box model

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

The box model describes how elements are structured:

  1. Content: The actual content (text, images)
  2. Padding: Space between content and border
  3. Border: Line around the padding
  4. Margin: Space outside the border

Total width = margin + border + padding + content + padding + border + margin

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

07

What are the different values for the `overflow` property?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain
  • visible (default): Content extends beyond container
  • hidden: Clips overflowing content
  • scroll: Always shows scrollbars
  • auto: Shows scrollbars only when needed
  • clip: Similar to hidden but more performant for animations
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

08

How do you center an element both horizontally and vertically?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Multiple methods:

Flexbox (recommended):

.container {
  display: flex;
  justify-content: center;
  align-items: center;
}

Grid:

.container {
  display: grid;
  place-items: center;
}

Absolute positioning:

.element {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

09

What are the different positioning values and how do they work?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain
  • static (default): Normal document flow
  • relative: Positioned relative to normal position, maintains space
  • absolute: Positioned relative to nearest positioned ancestor, removed from flow
  • fixed: Positioned relative to viewport, removed from flow
  • sticky: Switches between relative and fixed based on scroll position
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

10

What are media queries and how do you use them?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Media queries apply styles based on device characteristics:

/* Mobile first approach */
.container {
  width: 100%;
}

/* Tablet */
@media (min-width: 768px) {
  .container {
    width: 750px;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .container {
    width: 1000px;
  }
}

Common features: width, height, orientation, resolution.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

11

What is the difference between `min-width` and `max-width` in media queries?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain
  • min-width: Styles apply when viewport is equal to or larger than specified width (mobile-first)
  • max-width: Styles apply when viewport is equal to or smaller than specified width (desktop-first)
/* Mobile first */
@media (min-width: 768px) { /* Tablet and up */ }

/* Desktop first */
@media (max-width: 767px) { /* Mobile only */ }

Mobile-first is generally preferred for performance.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

12

Explain the viewport meta tag and its importance

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

The viewport meta tag controls how mobile browsers render pages:

<meta name="viewport" content="width=device-width, initial-scale=1.0">
  • width=device-width: Uses device's actual width
  • initial-scale=1.0: No initial zoom
  • user-scalable=no: Prevents zooming (avoid unless necessary)

Without this tag, mobile browsers use desktop viewport width (usually 980px).

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

13

How do you make images responsive?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Basic responsive image:

img {
  max-width: 100%;
  height: auto;
}

Advanced with srcset:

<img src="image-400.jpg"
     srcset="image-400.jpg 400w,
             image-800.jpg 800w,
             image-1200.jpg 1200w"
     sizes="(max-width: 600px) 400px,
            (max-width: 1000px) 800px,
            1200px"
     alt="Description">
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

14

What are vendor prefixes and are they still necessary?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Vendor prefixes indicate experimental CSS features:

  • -webkit-: Chrome, Safari, newer Edge
  • -moz-: Firefox
  • -ms-: Internet Explorer, old Edge
  • -o-: Opera (old)
.element {
  -webkit-transform: rotate(45deg); /* Safari/Chrome */
  -moz-transform: rotate(45deg);    /* Firefox */
  -ms-transform: rotate(45deg);     /* IE */
  transform: rotate(45deg);         /* Standard */
}

Modern CSS features need fewer prefixes. Use tools like Autoprefixer to add prefixes automatically.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

15

How do you use CSS `@import` and what are its limitations?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

@import loads external stylesheets:

/* Must be at top of stylesheet */
@import url("base.css");
@import url("components.css") screen and (min-width: 768px);
@import "utilities.css" layer(utilities);

/* Regular styles after imports */
.custom {
  color: red;
}

Limitations:

  • Blocks rendering until imported CSS loads
  • Can't be used conditionally
  • Must appear before other CSS rules
  • Better to use <link> tags for performance
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

16

How do you style placeholder text?

Part of Pro
17

What are screen reader-only CSS classes?

Part of Pro
Intermediate 57
18

What are CSS custom properties (CSS variables) and how do you use them?

Part of Pro
19

What is the difference between `:nth-child()` and `:nth-of-type()`?

Part of Pro
20

Explain attribute selectors and their variations

Part of Pro
21

What are pseudo-elements and how do they differ from pseudo-classes?

Part of Pro
22

What is `box-sizing` and what are its values?

Part of Pro
23

How do margins collapse and how can you prevent it?

Part of Pro
24

Explain `min-width`, `max-width`, and how they interact with `width`

Part of Pro
25

What is Flexbox and what problems does it solve?

Part of Pro
26

Explain the main axis and cross axis in Flexbox

Part of Pro
27

What are the flex properties (`flex-grow`, `flex-shrink`, `flex-basis`)?

Part of Pro
28

What is CSS Grid and how does it differ from Flexbox?

Part of Pro
29

Explain `grid-template-areas` and how to use it

Part of Pro
30

What is the difference between `fr` unit and percentage in CSS Grid?

Part of Pro
31

Explain the `z-index` property and stacking context

Part of Pro
32

What are CSS units and when should you use each?

Part of Pro
33

What is the `clamp()` function and how is it useful for responsive design?

Part of Pro
34

What is the difference between CSS transitions and animations?

Part of Pro
35

Explain the CSS transition properties

Part of Pro
36

What are CSS keyframes and how do you use them?

Part of Pro
37

Explain the animation properties in CSS

Part of Pro
38

What are CSS transforms and what types are available?

Part of Pro
39

What is the `transform-origin` property?

Part of Pro
40

How do you create a CSS-only flip card effect?

Part of Pro
41

What are CSS gradients and how do you create them?

Part of Pro
42

Explain CSS filters and their effects

Part of Pro
43

What are CSS counters and how do you implement them?

Part of Pro
44

Explain the `object-fit` and `object-position` properties

Part of Pro
45

How do you reduce CSS bundle size?

Part of Pro
46

How do you handle browser compatibility issues in CSS?

Part of Pro
47

How do you use `@supports` for feature detection?

Part of Pro
48

What is graceful degradation vs progressive enhancement?

Part of Pro
49

How do you test CSS across different browsers?

Part of Pro
50

What is BEM methodology and how do you implement it?

Part of Pro
51

What are CSS modules and how do they work?

Part of Pro
52

Explain the OOCSS (Object-Oriented CSS) methodology

Part of Pro
53

What is the difference between CSS-in-JS and traditional CSS?

Part of Pro
54

What is Atomic CSS and when would you use it?

Part of Pro
55

What are CSS logical properties and why are they useful?

Part of Pro
56

How do CSS nesting rules work?

Part of Pro
57

What are CSS environment variables and how do you use them?

Part of Pro
58

How do CSS math functions work?

Part of Pro
59

What is `color-scheme` and how does it work with dark mode?

Part of Pro
60

How do you create a sticky footer that stays at bottom?

Part of Pro
61

How do you create equal-height columns?

Part of Pro
62

How do you create responsive typography?

Part of Pro
63

How do you implement a CSS-only accordion?

Part of Pro
64

How do you create a CSS tooltip?

Part of Pro
65

How do you style form inputs consistently across browsers?

Part of Pro
66

How do you create custom radio buttons and checkboxes?

Part of Pro
67

How do you implement form validation styling with CSS?

Part of Pro
68

How do you create CSS for print media?

Part of Pro
69

What are CSS page break properties?

Part of Pro
70

How does CSS support accessibility?

Part of Pro
71

How do you debug CSS layout issues?

Part of Pro
72

What CSS linting rules should you follow?

Part of Pro
73

How do CSS scroll-snap properties work?

Part of Pro
74

What is the CSS `light-dark()` function?

Part of Pro
Expert 30
75

What is the `will-change` property and when should you use it?

Part of Pro
76

How do you create smooth 60fps animations?

Part of Pro
77

Explain 3D transforms and the `perspective` property

Part of Pro
78

What is the `clip-path` property and how do you use it?

Part of Pro
79

How do CSS masks work?

Part of Pro
80

What is the `isolation` property and when would you use it?

Part of Pro
81

How can you optimize CSS for better performance?

Part of Pro
82

What is Critical CSS and how do you implement it?

Part of Pro
83

How do CSS containment and the `contain` property work?

Part of Pro
84

What are the performance implications of different CSS properties?

Part of Pro
85

How do you organize CSS in large projects?

Part of Pro
86

What is CSS Container Queries and how do they work?

Part of Pro
87

Explain CSS cascade layers (`@layer`)

Part of Pro
88

What are CSS anchored positioning and how do they work?

Part of Pro
89

What is the `:has()` selector and how is it useful?

Part of Pro
90

What are CSS color functions and color spaces?

Part of Pro
91

How do CSS scroll-driven animations work?

Part of Pro
92

What is the CSS `@scope` rule?

Part of Pro
93

How do you implement a masonry layout with CSS?

Part of Pro
94

How do you optimize CSS for production?

Part of Pro
95

How do you implement CSS custom media queries?

Part of Pro
96

What is the CSS Paint API and how does it work?

Part of Pro
97

How do you implement CSS architecture for design systems?

Part of Pro
98

How do you handle CSS specificity conflicts in large applications?

Part of Pro
99

How do you implement responsive images with CSS?

Part of Pro
100

How do you optimize CSS for Core Web Vitals?

Part of Pro
101

What is CSS Subgrid and how does it work?

Part of Pro
102

What are CSS custom highlights and how do you use them?

Part of Pro
103

How do CSS trigonometric functions work?

Part of Pro
104

What are the latest CSS features and how do you stay updated?

Part of Pro

No matches

Try a different filter or search term.

Pro · $10/mo

89 of 104 CSS3 answers are gated.

Full answers, code samples, AI explanations - simpler, deeper, or as an interactive diagram. Cancel anytime.

  • Full answers + code
  • AI explain - simpler, deeper, or visualized
  • 1,000 AI credits / month
  • Cancel anytime

Change topic

Pick a different technology or stack. Your current topic stays put until you choose a new one.

Technologies
No technologies match “”.
Cross-cutting topics
No topics match “”.
By role
Stacks & frameworks

MEAN

MongoDB, Express, Angular, Node.js

MERN

MongoDB, Express, React, Node.js

LAMP

Linux, Apache, MySQL, PHP

Django

Python Full-Stack Development

Ruby on Rails

Convention over Configuration

JAM

JavaScript, APIs, and Markup

Serverless on AWS

Serverless Architecture on AWS

Cross-cutting topics 43 topics

Interviewers also test these - they're common to every stack, whichever one you picked above.

Flutter Mobile

Flutter Cross-Platform Mobile Development

Cross-cutting topics 44 topics

Interviewers also test these - they're common to every stack, whichever one you picked above.

Spring Boot

Enterprise Java Development

.NET

Microsoft Ecosystem

Vue

Vue.js, Vite, TypeScript, Tailwind, Node.js

Go Backend

Golang, gRPC, PostgreSQL, Redis, RabbitMQ

FastAPI

Python, FastAPI, SQLAlchemy, PostgreSQL

React Native

React, TypeScript, Redux, Firebase

iOS Native

Swift, SwiftUI, UIKit, Firebase

Android Native

Java, Jetpack Compose, Firebase

Web3 / Ethereum

Solidity, Ethereum, Hardhat, Foundry

DevOps / Platform

Docker, Kubernetes, Terraform, CI/CD

Core SWE Interview Prep

Data structures, algorithms, OS, concurrency, networking, git
Big-O & Complexity Analysis Arrays, Strings & Hash Tables Linked Lists, Stacks & Queues Trees, BSTs & Heaps Graphs Sorting, Searching & Recursion Operating Systems Concurrency & Multithreading Networking for Developers Git & Version Control API Design 45 Distributed Systems Fundamentals 34

Cross-cutting topics 43 topics

Interviewers also test these - they're common to every stack, whichever one you picked above.


Cross-cutting topics 45 topics

Interviewers also test these - they're common to every stack, whichever one you picked above.