Working with Root and Metadata Elements
In HTML, <HTML> is root element and <HEAD>,
<TITLE>, <BASE> ,<SCRIPT>,<STYLE >.. etc are metadata elements. Let's create an
HTML file to understand the root and metadata elements.
File Name: "metadata.html"
- <HTML>
- <HEAD>
- <STYLE type="text/css">
- body {color: red}
- </style>
- <meta name="car" contents="some of the cars are red.">
- <title>
- Red Cars.
- </title>
- <base href="http://www.w3.org/TR/HTML5/semantics.html#semantics" target="parent"/>
- </HEAD>
- <body>
- <H1> Red Cars
- </H>
- <P> This contents is related to Red cars of in the world.</P>
- <A href=""semantics.html#the-base-element">Base Element</A> -
- <A href="semantics.html#semantics">The Root Element</A>
- </BODY>
- </HTML>
Description
In the above HTML, we have used HEAD, STYLE, META,
TITLE, BASE, and BODY elements. In the HEAD element, we have used the STYLE element to define the style sheet properties for the document. In the META element, we have specified the description of the document and in the TITLE element, we have specified the title of the document. The BODY element is used to define the body of the document, which contains the H1 element to display the heading, the P
element to display the paragraph and the A element to display the links on the document.
Output :