<?xml version="1.0" encoding="utf-8"?>

CSS visibility vs. display

The display: none; declaration is often used for hiding/showing elements without deleting and recreating them. But doesn't the visibility: hidden; declaration do the same? Well, it does hide an element, but the latter still takes up space and distorts the layout. In contrast, the display:none; hides the element without affecting the layout.

Improve your UX & Product skills with interactive courses that actually work