The HTML blocking attribute
Quick answer
The HTML blocking attribute marks the resource as render-blocking until it is processed. It is used on the <script>, <link> and <style> elements.
Overview
The blocking attribute marks the resource as render-blocking until it is processed. It applies to the <script>, <link> and <style> elements.
It lets you explicitly hold first paint until a critical resource loads — the opposite of async/defer. Use it only for genuinely render-critical assets; it is a newer attribute still rolling out.
Syntax
<script blocking="render" src="critical.js"></script>
Values
| Value |
|---|
| render |
Best practices
- Declare the character encoding with <meta charset="utf-8"> first in the <head>.
- Load scripts with defer (or as modules) so they do not block parsing.
- Protect third-party resources with integrity and crossorigin (Subresource Integrity).
- Use resource hints like preload deliberately, paired with the right as value.
Frequently asked questions
What does the blocking attribute do?
Marks a resource as render-blocking.