css to body code example

Example 1: html body tage

<!DOCtype html>
<html>
   <body>
   		<!--This is the HTML Body tag.-->    
  </body>
</html>

Example 2: adding css to html body

Three ways to add CSS to the body of html:
	1)External CSS
	2)Internal CSS
	3)Inline CSS

1) Externally:  
    Type your css code in a file. Remember you file name.
	Then,
<head>
	<link rel="stylesheet" type="text/css" href="FileName.css" >
</head>

2) Internally:
	Type your cSS in the html file itself. (It is not preffered until
	little CSS code is to be added). This can be done by style tag.
	Example:
	<head>
	<style>
	h1 {
      text-color:red;
      text-size: 0.8em;
    }
    </style>
	</head>

3) Inline:
	This method is not used by developers as it is very lengthy and
	maintaining code becomes difficult.
	Example:
   <h1 style="color:blue;text-align:center;">Header file</h1>

Example 3: how to style body using css

body {
  /*type your styling here*/
}

Example 4: html body tag

<body>
  <!-- this is the body,the body 
	lement contains all the contents of an HTML document, 
	such as headings, paragraphs, images, hyperlinks, tables,
 	lists, etc -->
</body>

Tags:

Html Example