Questions
CSS questions
Choose a question page, learn the concept, then test your understanding with a quiz.
CSS em vs px: Why Use Relative Units for Sizes?
Learn when to use CSS em instead of px, how em scales with font size, and why rem is often better for predictable responsive spacing.
CSS text-overflow: ellipsis Not Working on Links
Learn why CSS text-overflow: ellipsis may not work on an anchor and how display, width, overflow, and white-space create truncated text.
CSS vertical-align: middle for Text Next to an Image
Learn why CSS vertical-align: middle may not center text beside an image, how inline baseline alignment works, and reliable flexbox solutions.
Can CSS Classes Inherit Other Classes? Understanding Reuse in CSS
Learn whether CSS classes can inherit other classes, and how to reuse styles in CSS using multiple classes, selectors, and practical patterns.
Can You Style Half of a Character in CSS? Techniques for Split Text Effects
Learn how to style half of a character in CSS using layered text, gradients, and pseudo-elements for dynamic split-letter effects.
Center Elements Horizontally and Vertically with CSS Flexbox
Learn how to center elements horizontally and vertically with CSS Flexbox, including flex-direction, alignment axes, rows, and common fixes.
Change HTML Input Placeholder Color with CSS
Learn how to change HTML input placeholder text color using the ::placeholder pseudo-element, with examples, browser notes, and common mistakes.
Check Whether an Element Has a Class in JavaScript
Learn how to check whether an HTML element contains a CSS class in plain JavaScript using classList.contains and safe alternatives.
Conditionally Apply a CSS Class in AngularJS
Learn how to conditionally apply a class in AngularJS using ngClass, selectedIndex, and ngRepeat with simple examples and common mistakes.
Containing Floated Elements in CSS: Clearfix and Modern Solutions
Learn why parents collapse around floated CSS children and how to contain floats with clearfix, flow-root, overflow, and modern layout tools.
Converting HTML and CSS to PDF in PHP: What to Expect and Common Approaches
Learn how HTML-to-PDF conversion works in PHP, why CSS support varies, and how to choose a practical server-side approach.
Fix CSS MIME Type text/html Errors in Gulp and BrowserSync
Learn why browsers reject CSS served as text/html, how to diagnose incorrect asset paths, and configure Gulp and BrowserSync correctly.
HTML Date Input Format: YYYY-MM-DD Values and Display
Learn why HTML date inputs use YYYY-MM-DD values, why their displayed format cannot be forced, and how to format dates safely in JavaScript.
HTML Triangle Characters for Up/Down Toggle Indicators
Learn which HTML triangle characters and entities to use for up/down toggle indicators, including Unicode symbols and practical examples.
Hide Scrollbars but Keep Scrolling in CSS
Learn how to hide scrollbars while keeping scrolling enabled using CSS, including browser-specific rules for Chrome, Firefox, and IE/Edge.
Hide Scrollbars with CSS While Keeping Scrolling
Learn how to hide page scrollbars with CSS across modern browsers, keep content scrollable, avoid common pitfalls, and improve accessibility.
Hide the IE10 Clear Field X Button with CSS
Learn how to hide Internet Explorer 10's built-in clear-field X button using the ::-ms-clear CSS pseudo-element safely.
How CSS Triangles Work: Borders, Zero Size, and Shape Tricks
Learn how CSS triangles work using zero width/height and borders. Understand the visual trick with clear examples and practical uses.
How to Add Space Between Flexbox Items in CSS
Learn how to set space between flexbox items using CSS gap, margins, and practical layout patterns with clear examples.
How to Align Checkbox and Label Text Consistently with CSS
Learn how to align checkbox inputs and labels consistently across browsers using simple HTML and CSS patterns.