🍋
Menu
CSS

Content Visibility

CSS content-visibility Property

A property enabling the browser to skip rendering of off-screen elements, dramatically improving initial page load.

技術的詳細

The Content Visibility layout algorithm distributes space along a main axis and aligns items along the cross axis. Key properties: flex-grow (expansion ratio), flex-shrink (shrinking ratio), and flex-basis (initial size before distribution). The shorthand 'flex: 1' expands to 'flex: 1 1 0%'. Gap property replaces margin hacks for spacing. Flexbox excels at navigation bars, card rows, centering content, and any layout where items share a single axis.

```css
/* Example: Content Visibility */
.element {
  /* Apply content visibility to this element */
  display: block;
  margin: 0 auto;
}
```

関連ツール

関連用語