HTML and CSS Reference
In-Depth Information
Code Comments
The first bold line in the preceding code example is an example of a code comment. To start a code comment, you
use the syntax <!-- and to close a comment you use --> . Code comments will not be displayed by your browser
but can be useful to you as a developer. You should use comments to document parts of your code, as notes to
yourself or to others reading your code. I also like to use them to signal the start of new layout sections, as with the
example in the preceding code sample:
<!-- Page Container -->
Adding a <header> Element to Each Template
Almost all web pages have a header section of some description. This section often contains information such
as a company logo, slogan, and site navigation links. HTML5 introduces a new <header> element that you can
use to define this section of your page's layout. You can use the <header> element more than once on a page, as
you will see shortly when you learn about the <article> element.
The code for this exercise can be found in folder 3.
1. Open the index.html and about.html files in your text editor.
2. Add a <header> element to both of your page templates. This should be placed within the container that
you just created.
<div id="container">
<!-- Header -->
3. Save the files.
4. Open the files in your web browser.
5. Inspect the page using your developer tools to make sure that the new <header> is showing up within the
container <div> (as shown in Figure 2-5).
Search WWH ::

Custom Search