Questions
CSS questions
Choose a question page, learn the concept, then test your understanding with a quiz.
How to Maintain the Aspect Ratio of a div with CSS
Learn how to keep a div responsive while preserving its aspect ratio using modern CSS and classic fallback techniques.
How to Make Bootstrap Columns the Same Height
Learn beginner-friendly ways to make Bootstrap columns equal height using Flexbox, table display, and practical layout patterns.
How to Make Only the Background Transparent in CSS
Learn how to make a CSS background semi-transparent without fading text or child elements using rgba(), hsla(), and modern techniques.
How to Make a Div Fill Remaining Screen Height in CSS
Learn how to make a content div fill the remaining screen height below a variable header using modern CSS layout techniques.
How to Make a Div Fill the Browser Height in CSS
Learn how to make a div span the full browser height using CSS, including 100%, min-height, and modern viewport units.
How to Make a div Fit Its Contents in CSS
Learn how to make a div only as wide as its content using CSS, including inline-block, fit-content, and common layout pitfalls.
How to Make the Body Fill the Full Browser Height in CSS
Learn how to make the body fill the browser height in CSS using html, body, min-height, and viewport units.
How to Offset HTML Anchors for a Fixed Header
Learn how to offset in-page HTML anchors when a fixed header covers content using CSS and JavaScript techniques.
How to Open a Bootstrap Dropdown on Hover Instead of Click
Learn how to make a Bootstrap dropdown open on hover instead of click, remove caret arrows, and understand the tradeoffs clearly.
How to Overlay One div Over Another in CSS
Learn how to overlay one div on another using CSS positioning, absolute positioning, and centering techniques.
How to Position a Div at the Bottom of Its Container in CSS
Learn how to place a div at the bottom of its container using CSS, including flexbox, grid, and positioning techniques.
How to Remove Input Focus Outline in CSS (Chrome) and Do It Accessibly
Learn how to remove or customize input focus outlines in CSS, especially in Chrome, while keeping forms accessible and usable.
How to Remove Space Between inline-block Elements in CSS
Learn why inline-block elements have gaps and how to remove space between them using practical CSS techniques and examples.
How to Remove an Inline Style Added with jQuery .css()
Learn how to remove inline styles added with jQuery .css(), including background-color, without affecting stylesheet defaults.
How to Remove the Blue Focus Border from a Button in Chrome with CSS
Learn why Chrome shows a blue focus border on buttons and how to style button focus states correctly with accessible CSS.
How to Resize Images While Keeping Aspect Ratio in CSS
Learn how to resize images in CSS without distortion by preserving aspect ratio using width, height, and max-width correctly.
How to Right-Align a Flex Item in CSS Flexbox
Learn the flexbox way to right-align an item using auto margins, justify-content, and flexible spacing in CSS layouts.
How to Select the First Element With a Class in CSS
Learn why `.red:first-child` fails in CSS and how to correctly target the first matching element using selectors like `:first-of-type`.
How to Set Table Cell Padding and Spacing in CSS
Learn how to replace HTML table cellpadding and cellspacing with CSS using padding and border-spacing correctly.
How to Stretch and Scale a CSS Background Image to Fit the Viewport
Learn how to scale a CSS background image to the browser viewport using background-size, cover, and contain with CSS only.