Café Wall Illusion
Perfectly straight, perfectly parallel rows of offset light and dark tiles appear to tilt and taper, purely because of a mid-gray mortar line running between them.
What you're seeing
Rows of alternating black and white tiles, each row offset from the one above by half a tile width, separated by thin gray "mortar" lines. Every mortar line is dead straight and perfectly horizontal - you can confirm it with a ruler against your screen - but they read as tilting, wedge-shaped, and non-parallel, converging and diverging along their length in a way that shouldn't be possible from straight lines.
Why it happens
The effect depends on a precise, almost fussy combination of ingredients: the tiles need to be high contrast (ideally pure black and white), the offset between rows needs to be around a quarter to half a tile width, and - critically - the line between rows needs to be a middle gray, not black or white. Remove the gray mortar line, or replace it with black or white, and the tilt effect collapses almost completely.
The leading explanation involves how neurons in early visual processing respond to edges of different contrast. Where a mortar line meets a black tile, local brightness contrast creates a response that's subtly different from where the same mortar line meets a white tile, and the visual system's edge-detection stage effectively "smears" the mortar line's perceived position slightly toward the darker tile at black/gray boundaries and slightly toward the lighter tile at white/gray boundaries. Repeated across an entire offset row, these tiny, alternating displacements accumulate into an apparent tilt along the whole length of the line - a phenomenon researchers sometimes call the "twisted cord" effect, since a genuinely twisted black-and-white cord laid in a straight line produces the same tilt illusion.
Because the tilt comes from local edge processing rather than any higher-level interpretation of the scene, the café wall illusion is one of the few illusions that's nearly impossible to talk yourself out of - knowing exactly why it happens doesn't make the lines look any straighter, since the distortion is introduced before the signal ever reaches the stage of perception where conscious interpretation could correct it.
What changes the strength of the effect
A few variables noticeably dial the illusion up or down, which is part of why it's such a popular teaching demonstration - you can turn the distortion on and off almost like a switch. Widening the mortar line past a certain point weakens the tilt, since the gray band stops sharing enough of an edge with each tile to pull the perceived boundary in either direction. Shifting the row offset closer to a full tile width (rather than a half or quarter) also weakens it, because the pattern starts to look like ordinary bricklaying rather than an alternating high-contrast grid. And desaturating the tiles from pure black-and-white toward two closer shades of gray reduces the contrast difference the effect depends on, softening the tilt even though the geometry hasn't changed at all.
A little history
The illusion takes its name from an actual building: a café at the base of St Michael's Hill in Bristol, England, tiled in an alternating black-and-white brick pattern with gray mortar, first noticed and written up by neuropsychologist Richard Gregory and psychologist Priscilla Heard in 1979 after a member of Gregory's lab spotted the effect on the real wall. It remains a favorite in vision science both because the physical mechanism is comparatively well understood and because it's cheap and easy to reproduce with nothing more than a printer or, as above, a few lines of CSS.
Related reading
For another illusion produced almost entirely at the level of low-level edge and contrast processing, see the Hermann grid illusion.