HTML offers six levels of headings, using paired tags, from Heading 1 ( <h1> ... </h1>
) to Heading 6 ( <h6> ... </h6>
).
Each browser displays the headings in boldface, using its default font and descending font sizes, from Heading 1 (the biggest) to
Heading 6 (the smallest).
- You can add CSS styles to change the Heading's font size, color, and other properties..
Use <h1>, <h2>, ..., for headings only.
Headings are important, search engines use document headings to index the structure and content of your web pages.
<!DOCTYPE html> <html> <head> <title>Example Headings</title> </head> <body> <h1>Heading 1</h1> <h2>Heading 2</h2> <h3>Heading 3</h3> <h4>Heading 4</h4> <h5>Heading 5</h5> <h6>Heading 6</h6> </body> </html>
Comments are used to insert notes into the document that are not displayed by the browser.
To add a comment, use the <!-- --> tag, placing the comment between the two pairs of dashes.
<h4>Example HTML with Comments</h4> <!-- This is a comment, Start Menu --> <ul> <li>Menu one</li> <li>Menu two</li> </ul> <!-- End Menu -->
<ul> <li>http://coursesweb.net/html/</li> <li>http://coursesweb.net/css/</li> </ul>
.some_class { display: list-item; }
var obj = { "courses": ["php", "javascript", "ajax"] }; var jsonstr = JSON.stringify(obj); alert(jsonstr); // {"courses":["php","javascript","ajax"]}
$strhtml = '<body><div id="dv1">CoursesWeb.net</div></body>'; $dochtml = new DOMDocument(); $dochtml->loadHTML($strhtml); $elm = $dochtml->getElementById("dv1"); echo $elm->nodeValue; // CoursesWeb.net