w3resource

HTML5: How to provide an HTTP header for the information or value of the content attribute?

Go to Exercise page

Solution:

HTML Code:

<!DOCTYPE html<<!-- Declares the document type and version of HTML --<
<html<<!-- Begins the HTML document --<
<head<<!-- Contains metadata about the document --<
<meta charset="utf-8"<<!-- Specifies the character encoding for the document --<
<title<How to provide an HTTP header for the information or value of the content attribute </title<<!-- Sets the title of the document --<
</head<<!-- Ends the head section --<
<body<<!-- Contains the content of the document --<
<h1<HTML http-equiv attribute</h1<<!-- Represents a level 1 heading --<
<p<HTML http-equiv attribute supports meta element.</p<<!-- Represents a paragraph of text --<
</body<<!-- Ends the body section --<
</html<<!-- Ends the HTML document --<

Explanation:

  • The HTML document starts with a declaration of its type and version (<!DOCTYPE html<).
  • The <html< element encloses the entire HTML document.
  • The <head< section contains metadata about the document.
  • The <meta charset="utf-8"< tag specifies the character encoding for the document as UTF-8, which supports a wide range of characters from various languages.
  • The <title< tag sets the title of the document, which appears in the browser's title bar or tab.
  • The <body< section contains the main content of the HTML document.
  • In this example, there is a level 1 heading <h1< and a paragraph <p< of text.

Live Demo:

See the Pen meta-http-equiv-answer by w3resource (@w3resource) on CodePen.


See the solution in the browser

Supported browser

Firefox logo Chrome logo Opera logo Safari logo Internet Explorer logo
Yes Yes Yes Yes Yes

Go to Exercise page

What is the difficulty level of this exercise?

Test your Programming skills with w3resource's quiz.



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://www.w3resource.com/html-css-exercise/basic/meta-http-equiv-answer.php