Questions

CSS questions

Choose a question page, learn the concept, then test your understanding with a quiz.

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.

csshtmlwidth

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.

csshtmlheight

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.

cssjavascripthtmlanchor

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.

cssdrop-down-menutwitter-bootstrap

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.

csshtmlpositionoverlay

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.

csshtml

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.

cssgoogle-chromeinputfocus

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.

csshtmlflexbox

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.

cssjavascriptjquery

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.

cssgoogle-chrome

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.

cssimageaspect-ratio

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.

csshtmlflexbox

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`.

csscss-selectors

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.

csshtmlhtml-tablealignment

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.

cssbackground

How to Transition Height from 0 to Auto in CSS

Learn why CSS cannot transition height: auto and how to create smooth expand-collapse effects using max-height and alternatives.

csscss-transitions

How to Use :not() and :first-child in CSS Selectors

Learn how to target every element except the first using CSS :not() and :first-child, with clear examples and common mistakes.

csscss-selectors

How to Use CSS content with HTML Entities in CSS

Learn why HTML entities do not work in CSS content and how to insert characters correctly with quoted text or Unicode escapes.

csshtmlhtml-entitiescss-content

How to Vertically Align Elements in a Div with CSS

Learn how to vertically align images and headings inside a div using modern CSS, including flexbox and absolute positioning.

csshtmlvertical-alignment

How to Vertically Align Text in a div with CSS

Learn how vertical text alignment works in CSS, why `vertical-align` fails on divs, and practical ways to center content correctly.

csshtmlvertical-alignment

Page 3 of 4 - 72 questions