HTML Documents

Create HTML Documents

HTML documents are text files containing html tags. HTML tags in HTML documents mark up Web pages.

Save the following to a text file named index.htm, and drag and drop it to a browser.


<!DOCTYPE HTML>
<html> 
    <body> 
        <h1>My Heading</h1> 
        <p>My paragraph</p> 
    </body> 
</html> <!--from  w w  w.  ja v a2  s.  c om-->

Click to view the demo

The HTML document starts with <!DOCTYPE HTML>. <!DOCTYPE HTML> tells the browser this is a html document.

The content between <html> and </html> marks the Web page. <body> and </body> makrs the visible page content. <h1> and </h1> is uses to define a heading. <p> and </p> creates a paragraph.

The code above generates the following result.

HTML Documents