<body> Tag Syntax
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>My Title</title> ... metadata content ... </head> <body> ... flow content ... </body> </html>
Rules for coding the HTML body element
Make sure you understand the difference between a tag and element and are familiar with the definitions of namespace and other HTML terms.
- Code the body element for the body section after the end of the head element inside the html element.
- Begin the body element with a starting <body> tag. The element name uses lower case letters and should be in the HTML namespace, which it will pick up automatically from the
xmlns
attribute on the <html> tag. - Code the content of the document inside the body element.
- End the body element with a matching
</body>
closing tag.
Content of the body element
The content of the body element can include HTML comments, text content and any tags that can be used in flow content.