---
title: "Two lines of Cross-Document View Transitions code you can use on every website today"
description: "Adding `@view-transition { navigation: auto; }` to a site's CSS enables cross-document View Transitions, so elements shared between pages stay fixed and everything else crossfades instead of flashing blank between navigations."
url: "https://swe.quest/articles/two-lines-of-cross-document-view-transitions-code-you-can-use-on-every-website-87eda278df990c07"
canonical: "https://webkit.org/blog/16967/two-lines-of-cross-document-view-transitions-code-you-can-use-on-every-website-today/"
source: "WebKit"
published: "2025-05-21"
difficulty: "medium"
kind: "How-to"
reading_minutes: 4
tags: ["css","browsers","frontend","accessibility"]
---

# Two lines of Cross-Document View Transitions code you can use on every website today

A post on [WebKit](https://swe.quest/sources/webkit.md), published 2025-05-21, 4 min read, How-to. Original: [https://webkit.org/blog/16967/two-lines-of-cross-document-view-transitions-code-you-can-use-on-every-website-today/](https://webkit.org/blog/16967/two-lines-of-cross-document-view-transitions-code-you-can-use-on-every-website-today/)

## Summary

Adding \`@view-transition { navigation: auto; }\` to a site's CSS enables cross-document View Transitions, so elements shared between pages stay fixed and everything else crossfades instead of flashing blank between navigations. A simple crossfade doesn't introduce motion and generally needn't be disabled under \`prefers-reduced-motion\`. Support covers Safari 18.2, Chrome 126 and Edge 126 (about 85% of users), and unsupported browsers simply ignore the rule, making it a safe progressive enhancement.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [CSS](https://swe.quest/tags/css.md) (Web & mobile)
- [Browsers](https://swe.quest/tags/browsers.md) (Web & mobile)
- [Frontend](https://swe.quest/tags/frontend.md) (Web & mobile)
- [Accessibility](https://swe.quest/tags/accessibility.md) (Web & mobile)

## Prerequisites

- CSS at-rules ([easy posts on CSS](https://swe.quest/tags/css.md?difficulty=easy))

## Keywords

View Transitions API, @view-transition, prefers-reduced-motion, Safari 18.2, WebKit

## Related posts

- [WebKit Features in Safari 18.2](https://swe.quest/articles/webkit-features-in-safari-18-2-9cf887b031bc5207.md): WebKit · 2024-12-09 · Medium · 22 min read · Browsers, CSS, Frontend, WebAssembly
  Safari 18.2 ships 61 new WebKit features and 111 fixes, headlined by cross-document View Transitions (with view-transition-name: auto, transition classes and types, and pageswap/pagereveal events), CSS text-box trimming for optical alignment to cap height, and background-clip: border-area.
- [WebKit Features in Safari 18.0](https://swe.quest/articles/webkit-features-in-safari-18-0-21b8c1f56b7c7e96.md): WebKit · 2024-09-16 · Medium · 36 min read · Browsers, CSS, Frontend
  Safari 18.0 ships 53 new web platform features, 25 deprecations and 209 fixes in WebKit alongside iOS 18, macOS Sequoia and visionOS 2.
- [News from WWDC24: WebKit in Safari 18 beta](https://swe.quest/articles/news-from-wwdc24-webkit-in-safari-18-beta-f6c733f3db9a46ad.md): WebKit · 2024-06-10 · Medium · 34 min read · Browsers, CSS, Frontend
  Safari 18 beta ships 48 new web platform features, 18 deprecations and 174 bug fixes across iOS 18, iPadOS 18, visionOS 2 and macOS Sequoia betas.
- [Fresh 2.3: Zero JS by default, View Transitions, and Temporal support](https://swe.quest/articles/fresh-2-3-zero-js-by-default-view-transitions-and-temporal-support-78d123ca76300941.md): Deno · 2026-04-24 · Medium · 7 min read · Frontend, JavaScript, Web performance, Browsers
  Fresh 2.3 now skips the client-entry bootstrap script entirely on pages that use no islands or partials, cutting static pages from roughly 5–9 KB gzipped JavaScript to zero with no configuration.
- [WebKit Features for Safari 26.4](https://swe.quest/articles/webkit-features-for-safari-26-4-69cb77acb4c1c530.md): WebKit · 2026-03-24 · Medium · 34 min read · Browsers, CSS, Frontend
  Safari 26.4 ships 44 features, 191 fixes and one deprecation, headlined by CSS Grid Lanes (\`display: grid-lanes\`) for masonry-style layouts with \`flow-tolerance\` control, WebTransport as a low-latency WebSocket alternative, and the Keyboard Lock API.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
