Tag

#layout

16articles
GuidesOct 31, 2026

Why your CSS transition isn't working — 4 reasons the element jumps instead of animating

Why a CSS transition doesn't work: display none, height auto, a class added in the same frame, and animations turned off. How to check each cause and fix it.

6 min read
GuidesOct 29, 2026

Why my page jumps when a modal opens — and why you can't see it on a Mac

Does your page shift sideways when a modal opens? Here's the cause — a disappearing scrollbar — and the fix with scrollbar-gutter: stable and padding-right.

5 min read
BasicsOct 29, 2026

border vs outline — the difference, and why a hover border makes everything jump

border vs outline in CSS: the difference, why a border on hover shifts your layout by 2 pixels while outline doesn't, and which to use for focus and cards.

5 min read
GuidesOct 27, 2026

Why my numbers jump when they change — the timer jitters and the text next to it moves

Why a timer or counter jitters and shifts the text beside it: proportional digits, changing digit count, and fonts without tabular-nums. How to fix it.

6 min read
GuidesOct 27, 2026

How to make a carousel (slider) with CSS — no library, native swipe

How to build a pure-CSS carousel with scroll-snap: native swipe on phones, arrows and dots in 20 lines of JS, no slider library and no broken Back gesture.

7 min read
BasicsSep 18, 2026

What is line-height — and why 1.5 and 150% give different results

What line-height is in plain words: how the browser builds a line box, why 1.5 and 150% inherit differently, and what value to use for body text.

5 min read
BasicsSep 18, 2026

What are CSS variables — and why they live inside the browser

What CSS variables are in plain words: how var() works, why they inherit unlike Sass variables, and the three gotchas that trip up almost everyone.

5 min read
GuidesSep 18, 2026

How to truncate text with an ellipsis in CSS — step by step

How to truncate text with CSS: one property isn't enough, you need three. Single-line, multi-line clamping, and the flexbox trap that breaks both.

5 min read
BasicsSep 18, 2026

em or rem — what's the difference and which to use

em vs rem in CSS: what each unit measures against, where em compounds and breaks, and why both ignore your html font-size inside media queries.

5 min read
BasicsSep 17, 2026

What is z-index — and why 9999 doesn't help

What z-index actually is: why a modal with z-index 9999 still slips under the header, what a stacking context is, and how to fix it without bigger numbers.

5 min read
BasicsSep 17, 2026

What is the CSS box model — and why your block is wider than you set

The CSS box model in plain words: why width 350px renders as 370px, what box-sizing border-box changes, and why four 25% columns don't fit on one line.

5 min read
BasicsSep 17, 2026

What is a container query — the media query that doesn't look at the screen

CSS container queries in plain words: why @media fails a component in a narrow sidebar, how @container works, and the two traps tutorials skip.

5 min read
GuidesSep 17, 2026

How to center a div — 4 ways and when to use each

How to center a block horizontally and vertically: margin auto, flex, grid and the new align-content in a plain block. With code and a rule for picking one.

6 min read
BasicsSep 16, 2026

object-fit: cover vs contain — which one stops images from squashing or getting cropped

object-fit: cover vs contain compared on cropping, empty bars, card grids and photos of people. Plus scale-down for logos and object-position.

6 min read
GuidesSep 14, 2026

Why position: sticky isn't working — 3 causes and how to find yours in a minute

Your position: sticky header scrolls away with the page? Three common causes — a missing top, overflow on a parent, no room to move — and how to check each.

6 min read
GuidesSep 9, 2026

Why my page jumps while loading — 3 causes and how to check

Content shoves itself down and you miss the button. Why a page jumps while loading: three real causes, how to find the culprit and how to fix each one.

5 min read