HTML - attributes - http-equiv

revision:


Content

"http-equiv" attribute : provides an HTTP response header syntax some examples


"http-equiv" attribute : provides an HTTP response header

top

It provides an HTTP header for the information/value of the content attribute. It can be used to simulate an HTTP response header.
The http-equiv element is considered obsolete and should not be used. To specify the content type of a document, use the "charset attribute" of the "meta element" instead.


syntax

top

<meta http-equiv="content-security-policy|content-type|default-style|refresh">

content-security-policy specifies a content policy for the document. Example:<meta http-equiv="content-security-policy" content="default-src 'self'">

content-type specifies the character encoding for the document. Example: <meta http-equiv="content-type" content="text/html; charset=UTF-8">

default-style specifies the preferred style sheet to use.Example: <meta http-equiv="default-style" content="the document's preferred stylesheet">. Note: The value of the content attribute above must match the value of the title attribute on a link element in the same document, or it must match the value of the title attribute on a style element in the same document.

refresh defines a time interval for the document to refresh itself. Example: <meta http-equiv="refresh" content="300">. Note: The value "refresh" should be used carefully, as it takes the control of a page away from the user. Using "refresh" will cause a failure in W3C's Web Content Accessibility Guidelines.


some examples

top
codes:
                    <head>
                        <title>HTML http-equiv Attribute</title>
                        <meta name="keywords about" content="Meta Tags, Metadata" />
                        <meta name="description" content="Learning about Meta Tags." />
                        <meta name="revised about" content="coding page" />
                        <meta http-equiv="refresh" content="8" />
                    </head>
                
codes:
                    <meta http-equiv="pragma" content="no-cache" />
                    <meta http-equiv="cache-control" content="max-age=0" />
                    <meta http-equiv="cache-control" content="no-cache" />
                    <meta http-equiv="cache-control" content="no-store" />