Skip to content

HTML content Attribute

The content attribute specifies a value associated with the name or http-equiv attribute.

You can only use this attribute on the meta element to set meta information in an HTML document.

Syntax

html
<meta name="description" content="A description of the document">

Example of the HTML content attribute

html
<!DOCTYPE html>
<html>
  <head>
    <meta name="description" content="Online Free Tutorials" />
    <meta name="keywords" content="HTML,CSS,JavaScript,PHP, Git" />
    <meta http-equiv="refresh" content="30" />
  </head>
  <body>
    <h1>Example of the HTML "content" attribute</h1>
    <p>Lorem ipsum, or lorem ipsum as it is sometimes known, is dummy text used in laying out print, graphic or web designs. The passage is attributed to an unknown typesetter in the 15th century who is thought to have scrambled parts of Cicero's De Finibus Bonorum et Malorum for use in a type specimen book.</p>
  </body>
</html>

Practice

What are the valid uses of the HTML content attribute according to the provided web resource?

Dual-run preview — compare with live Symfony routes.