<body> - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:body

Introduction

The body element marks the content of an HTML document.

The body element follows the head element as the second child of the html element.

The body Element summary

Item Value
Element body
Element Type N/A
Permitted Parents html
Local Attributes None
Contents All phrasing and flow elements
Tag Style Start and end tag required
New in HTML5 No
Changes in HTML5 alink, background, bgcolor, link, margintop, marginbottom, marginleft, marginrightm, marginwidth, text, and vlink attributes are obsolete; Use CSS instead

Style Convention

body { 
   display: block; 
   margin: 8px; 
} 

body:focus { 
    outline: none; 
}

Using the body Element

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
   <head> 
      <title>Example</title> 
   </head> 
   <body> 
      <p>
          I like 
         <code id="myId">HTML</code>
          and CSS. <!--from   w w w .j a va2s.c  o m-->
      </p> 
      <a href="http://java2s.com">Visit java2s.com</a>  
   </body>
</html>

Related Tutorials