HTTP-equiv Directives

HTML meta http-equiv="content-security-policy"

Applies a supported Content Security Policy from a meta element. It cannot enforce directives such as frame-ancestors and does not protect resources processed before it; prefer the HTTP response header for full policy coverage.

Formal Syntax & Structure

html syntaxhtml
<meta http-equiv="content-security-policy" content="default-src 'self'; object-src 'none'; base-uri 'self'">

Parameters & Attributes

NameTypeDescription
http-equivpragma keywordUse content-security-policy.
contentdirective-specific valueExample: default-src 'self'; object-src 'none'; base-uri 'self'.

Working Example

Example Snippethtml
<!doctype html><html lang="en">  <head>    <meta charset="utf-8">    <title>Example</title>    <meta http-equiv="content-security-policy" content="default-src 'self'; object-src 'none'; base-uri 'self'">  </head>  <body>    <p>Example document</p>  </body></html>
HTML Reference