HTML content Attribute

The content attribute of the <meta> element is used to set the meta information in an HTML document. This can be the information for the description or the keywords, for name attribute.

Following is the syntax:

<meta content="text">

Above, the text is the meta information.

Let us now see an example to implement the content attribute of the <meta> element:


 Live Demo

<!DOCTYPE html>
<meta name="description" content="Learn for free">
<p>Programming tutorials for free:</p>


In the above example, under the <head> element, we have set the <meta> description:

<meta name="description" content="Learn for free">

The description i.e. the meta information is set using the content attribute of the <meta> element:

content="Learn for free"

Updated on: 30-Jul-2019


Kickstart Your Career

Get certified by completing the course

Get Started