HTML Documents

Home     Building Blocks     HTML Documents     Tags     Hyperlinks     CSS     Forms


How an HTML document is structured

      The basic structure of any HTML document is as follows:

The basic structure of an HTML document. This is what the HTML document would look like in a browser window.  Notice that there is no content on the screen.

 

The basic HTML document with simple content. An HTML document viewed in the browser window.  Notice the addition of text in the window as well as a title for the page in the browser title bar.

 


Naming Conventions


Begin creating an HTML document

Let's practice creating an HTML document and viewing it in the browser window.

Before you begin though, we'll need to create a folder to store our work.  For these activities we'll store our work on the Desktop.  Create a new folder for storing your work and name the new folder your last name for easy identification.

The common HTML authoring environment is to have your text or HTML editor running simultaneously with at least one browser. As you create your HTML code in the editor, you should frequently save, jump to the browser, and refresh your page to check your work.

  1. Launch a text editor such as Notepad. Notepad will save the text in pure ASCII format without the proprietary formatting that usually goes along with documents saved in word processing programs like MSWord.

  2. Type the following code to create the basic structure of any web page:

    <html>
    <head>
    </head>

    <body>
    </body>

    </html>
     

  3. Save your Web page to your folder on the desktop. Give the document the .htm or .html extension before saving. This is very important. Name the file yourlastname_kitchen.html

  4. Continue to keep Notepad open and navigate to your newly created html file.  Double click on it and it should open in your browser window.  You will have two windows open and can now work back and forth between Notepad and your browser. 

  5. After making changes in Notepad, choose save, and then refresh in the browser window to see the changes.  (If you close the windows, just open your .html file again and choose view>source from the menu to access the text file.)

TIP: For a more organized working environment, tile your windows by right clicking on the taskbar at the bottom of your screen and choose "Tile Windows Horizontally".

Practice adding content to your Web page


What Browsers Ignore


DOCTYPES and Encoding

The DOCTYPE is included at the top of a Web page and declares the type of HTML or XHTML the Web Page is using. Typical DOCTYPE and Encoding declarations are shown below:

  More About DOCTYPES and Encoding


 
  Getting Started with HTML
http://www.w3.org/MarkUp/Guide/

Test Yourself