Now that we have entered the basic structure of your HTML file, lets learn about the content.
Marking the Head Element
In general, the head element is where you provide browsers with information about your document. This can include the page's title, the location of any style sheets used with the document, the location of any programs that browsers should run when they load the page, and information to use by search engines to aid users in locating the Web site.
Defining the Page Title
The first element that you will be adding to your page is the title element. This has the syntax of:
<title> document title </title>
While the document title is the text of the document title, it is important to know that it does NOT get displayed within the page. It is however, typically displayed on the browser's title bar or on a browser tab. The document title is also used by search engines like Google or Yahoo! when compiling an index of search results.
Adding Comments
As you write your HTML file, you can add notes or comments about your code. These comments might include the name of the document's author and the date the document was created. Such notes are not intended to be displayed by the browsers, but are instead used to help explain your code to yourself and others. To add notes or comments, insert a comment tag. A comment tag on the HTML has the syntax of:
<!-- comment -->
A comment can spread out over several lines when needed. Also, because they are ignored by the browser, they can be added anywhere within the html element.
Displaying an HTML File
Find your file in your H-Drive and simply right click on your j-prop.htm file. Open this file through Google Chrome for best results.
Defining the Structure of the Page Body
It's always a good idea to plan your We page before you start coding it. You can do this by drawing a sketch or by creating a sample document within a word processor. Your preparatory work can weed our textual errors or point out potential problems in your page layout.
Working with HTML5 Structural Elements
Each part of Dave's document can be marked using HTML5 structural elements, which are elements that define the major sections of a Web page. Figure 1-9 describes some of these elements.
For example, to mark the header of your Web page, you would enter a header element within the page body. The syntax for a header is:
<header> header content </header>
Where header content is the page content that you want displayed within the page header. One of the reasons we want to define these structural elements is that we can write styles for them and define the layout of the Web page content.
Making a Section with the div Element
The structural elements are part of the current specifications for HTML5 to identify different page divisions. The syntax of the div element is:
<div id="id"> content </div>
where id is a unique name assigned to the division and content is page content contained within the division. while not required, the id attribute is useful to distinguish one div element from another. This becomes particularly important if you apply different styles to different page divisions.