Working with Root and Metadata Elements

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"
  1. <HTML>  
  2.     <HEAD>  
  3.         <STYLE type="text/css">  
  4.               body {color: red}             
  5.         </style>  
  6.         <meta name="car" contents="some of the cars are red.">  
  7.             <title>  
  8.                   Red Cars.  
  9.          </title>  
  10.             <base href="http://www.w3.org/TR/HTML5/semantics.html#semantics" target="parent"/>  
  11.         </HEAD>  
  12.         <body>  
  13.             <H1> Red Cars  
  14.             </H>  
  15.             <P> This contents is related to Red cars of in the world.</P>  
  16.             <A href=""semantics.html#the-base-element">Base Element</A> -      
  17.             <A href="semantics.html#semantics">The Root Element</A>  
  18.         </BODY>  
  19.     </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.
 
Image-1.jpg 
 
Output :
 
Image-2.jpg
Next Recommended Reading Sectioning Root Tags In html 5

Foreantech
Foreantech - A complete online solution company.