<link rel="expect">
The rel="expect" attribute for the <link> HTML element is a hint to the browser to block rendering until the element that the href value references is connected to the document and fully parsed. It is most useful when native HTML semantics or browser capabilities can replace custom implementation work.
Overview
The rel="expect" attribute for the <link> HTML element is a hint to the browser to block rendering until the element that the href value references is connected to the document and fully parsed. It is most useful when native HTML semantics or browser capabilities can replace custom implementation work.
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
html.elements.link.rel.expect Experimental | 124 | 124 | | | 124 | |
Syntax
<link rel="expect" href="#hero" blocking="render">
<!-- #hero要素がDOMに追加されるまでレンダリングをブロック -->
<section id="hero">
<h1>Main Content</h1>
</section> Live demo
Expectation hint
Describe rel=expect as a hint about the kind of content a link is expected to load.
Experimental feature note
Treat rel=expect as an emerging hint rather than a broadly deployed production feature.
Implementation advice
Keep ordinary navigation and loading correct even when experimental hints are ignored.
Use cases
Control document behavior
Use <link rel="expect"> to influence loading, metadata, or script behavior at the document level.
Tune performance strategy
Apply <link rel="expect"> when earlier resource hints or document settings improve startup or runtime behavior.
Cautions
- Test <link rel="expect"> in your target browsers and input environments before depending on it as a primary behavior.
- Provide a fallback path or acceptable degradation strategy when support is still limited.
Accessibility
- Make sure <link rel="expect"> supports the intended task without making the page harder to perceive, understand, or operate.
Related links
Powered by web-features