1.

HTML Elements: Sectioning the Root

Answer»

  • <body>...</body>:The content of an HTML document is represented by the HTML <body> element. In a HTML document, there can only be one <body> element. Some of the attributes that can be used along with the <body> element are as follows:


    • <body bgcolour=?>: This is used for setting the background colour of the body via name or hex value.


    • <body text=?>: This is used for setting the text colour via name or hex value


    • <body link=?>: This is used for setting the colour of links via name or hex value


    • <body vlink=?>: This is used for setting the colour of visited links via name or hex value


    • <body alink=?>: This is used for setting the colour of active links (during mouse clicking)


An example illustrating the use of the body element is given below:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title> HTML Cheatsheet </title>
<link rel="stylesheet" href="styles.css">
<style>
h1 {colour:green;}
p {colour:yellow;}
</style>
</head>
<body bgcolour="red">
<p>This is a HTML cheatsheet </p>
</body>
</html>

  • HTML Comments: Although HTML comments are not visible in the browser, they can aid in the documentation of your HTML source code. We can add comments to our HTML code by enclosing them within the symbole: <!-- →. The following syntax shows how to add comments to your HTML source:
<!-- We can write our comments over here -->


Discussion

No Comment Found