Questions
CSS questions
Choose a question page, learn the concept, then test your understanding with a quiz.
How to Align Content to the Bottom of a Div in CSS
Learn how to align content to the bottom of a fixed-height div using CSS, with simple examples using flexbox and older techniques.
How to Auto-Resize Images While Maintaining Aspect Ratio in CSS
Learn how to resize images to fit a container while preserving aspect ratio using simple CSS techniques and practical examples.
How to Center Text Horizontally and Vertically Inside a Div in CSS
Learn how to center text inside a div both horizontally and vertically using CSS with flexbox, grid, and line-height.
How to Center a Bootstrap 3 Column in the Grid System
Learn how to center a column in Bootstrap 3 using rows, offsets, and text alignment with clear examples and common mistakes.
How to Center a div Horizontally in CSS
Learn how to center a fixed-width div horizontally in CSS using margin auto, with examples, mistakes, and real-world layout tips.
How to Center an Absolutely Positioned Element in CSS
Learn how to center an absolutely positioned element in CSS, even when its width is unknown or responsive.
How to Center an Absolutely Positioned Element in CSS
Learn how to center an element with position:absolute in CSS, why margin:auto fails, and the best centering techniques with examples.
How to Change SVG Color in CSS: fill, img, image, and Inline SVG
Learn why CSS fill does not color an external SVG in HTML and how to correctly change SVG colors using inline SVG and currentColor.
How to Change the Color of an HR Element in CSS
Learn how to change the color of an HTML hr element using CSS, including border styling, modern examples, and common mistakes.
How to Change the Cursor to a Hand on Hover in HTML and CSS
Learn how to use the CSS cursor property to show a hand pointer when hovering over list items in HTML and CSS.
How to Click Through an Overlay Div in CSS and JavaScript
Learn how to click through an overlay div using CSS pointer-events, with examples, common mistakes, and real-world use cases.
How to Combine a Background Image and CSS Gradient on the Same Element in CSS
Learn how to layer a CSS gradient and background image on one element using multiple backgrounds, with examples and common mistakes.
How to Create a Placeholder for a Select Box in HTML and CSS
Learn how to add a placeholder-like default option to an HTML select box using valid HTML, CSS, and simple best practices.
How to Disable Text Selection Highlighting in CSS
Learn how to disable text selection highlighting with CSS using user-select, vendor prefixes, examples, pitfalls, and best practices.
How to Disable a Link Using CSS
Learn what CSS can and cannot do when disabling links, plus practical patterns for inactive navigation links and accessible alternatives.
How to Handle :hover Styles Without Inline CSS in HTML and Email
Learn why `a:hover` cannot be written in inline CSS, how pseudo-classes work, and what practical alternatives exist in HTML and email.
How to Hide Number Input Spin Buttons in HTML and CSS
Learn how to hide HTML5 number input spin buttons using CSS, browser-specific rules, and practical form styling tips.
How to Horizontally Center an Element in CSS
Learn how to horizontally center a div in CSS using margin auto, flexbox, and grid with beginner-friendly examples and common mistakes.
How to Inspect :hover State in Chrome DevTools
Learn how to force and inspect the :hover state in Chrome DevTools so you can debug CSS for links, buttons, and interactive elements.
How to Limit Text to N Lines in CSS with Ellipsis
Learn how to clamp text to a fixed number of lines in CSS, add ellipsis, and handle overflow with practical examples and common pitfalls.