- HTML Tutorial
- HTML - Home
- HTML - Introduction
- HTML - Editors
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Headings
- HTML - Paragraphs
- HTML - Fonts
- HTML - Blocks
- HTML - Style Sheet
- HTML - Formatting
- HTML - Quotations
- HTML - Comments
- HTML - Colors
- HTML - Images
- HTML - Image Map
- HTML - Iframes
- HTML - Phrase Elements
- HTML - Meta Tags
- HTML - Classes
- HTML - IDs
- HTML - Backgrounds
- HTML Tables
- HTML - Tables
- HTML - Headers & Caption
- HTML - Table Styling
- HTML - Table Colgroup
- HTML - Nested Tables
- HTML Lists
- HTML - Lists
- HTML - Unordered Lists
- HTML - Ordered Lists
- HTML - Definition Lists
- HTML Links
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML Color Names & Values
- HTML - Color Names
- HTML - RGB
- HTML - HEX
- HTML - HSL
- HTML Forms
- HTML - Forms
- HTML - Form Attributes
- HTML - Form Control
- HTML - Input Attributes
- HTML Media
- HTML - Video Element
- HTML - Audio Element
- HTML - Embed Multimedia
- HTML Header
- HTML - Head Element
- HTML - Adding Favicon
- HTML - Javascript
- HTML Layouts
- HTML - Layouts
- HTML - Layout Elements
- HTML - Layout using CSS
- HTML - Responsiveness
- HTML - Symbols
- HTML - Emojis
- HTML - Style Guide
- HTML Graphics
- HTML - SVG
- HTML - Canvas
- HTML APIs
- HTML - Geolocation API
- HTML - Drag & Drop API
- HTML - Web Workers API
- HTML - WebSocket
- HTML - Web Storage
- HTML - Server Sent Events
- HTML Miscellaneous
- HTML - MathML
- HTML - Microdata
- HTML - IndexedDB
- HTML - Web Messaging
- HTML - Web CORS
- HTML - Web RTC
- HTML Demo
- HTML - Audio Player
- HTML - Video Player
- HTML - Web slide Desk
- HTML Tools
- HTML - Velocity Draw
- HTML - QR Code
- HTML - Modernizer
- HTML - Validation
- HTML - Color Picker
- HTML References
- HTML - Cheat Sheet
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
- HTML Resources
- HTML - Quick Guide
- HTML - Useful Resources
- HTML - Color Code Builder
- HTML - Online Editor
HTML - http-equiv Attribute
HTML http-equiv is an attribute used to specify an HTTP header for the document's metadata, typically used to control the behavior of the browser or server. This attribute is named http-equiv, because all the allowed values are names of particular HTTP headers.
If the value of the http-equiv attribute is set to refresh and the content attribute accepts the time interval and URL of any website or page, it will refresh the page and redirect it to the given URL after the time interval. The refresh instruction specifies the number of seconds until the page should be reloaded, only if the content attribute contains a non-negative value.
Syntax
<meta http-equiv = "value"></meta>
Following are the list of values supported by the http-equiv
- content-security-policy
- content-type
- default-style
- x-ua-compatible
- refresh
Applies On
Below listed elements allow using of the HTML http-equiv attribute
Element | Description |
---|---|
<meta> | HTML <meta> tag is used to add meta data to a webpage. |
Example of HTML http-equiv Attribute
Below examples will illustrate the HTML http-equiv attribute, where and how we should use this attribute!
Refresh webpage using 'http-equiv' Attribute
In the following example, the HTML 'http-equiv' attribute is used within an <meta> element to define a pragma directive. We specify the string "refresh" as the value of this attribute which defines that the page should refresh with respect to the time interval.
<!DOCTYPE html> <html lang="en"> <head> <!--http-equiv attribute--> <meta http-equiv="refresh" content="10"> <title>HTML 'http-equiv' attribute</title> </head> <body> <h3> Example of the HTML 'http-equiv' attribute </h3> <p> The page should be refreshed automatically with respect to the time interval. </p> </body> </html>
Redirect webpage after Certain Time
Consider the another scenario, where we are going to use the ‘http-equiv’ attribute within the <meta> tag to redirect the current webpage to a different page after certain interval.
<!DOCTYPE html> <html lang="en"> <head> <!-- HTML http-equiv Attribute--> <meta http-equiv="refresh" content="5;url=/html/html_overview.htm" > <title>HTML 'http-equiv' attribute</title> </head> <body> <h3>HTML 'http-equiv' Attribute</h3> <p> The page will redirect to the HTML Introduction website after 5 seconds. </p> </body> </html>
Supported Browsers
Attribute | |||||
---|---|---|---|---|---|
http-equiv | Yes | Yes | Yes | Yes | Yes |
To Continue Learning Please Login
Login with Google