.
How to use HTML�to structure a web page
1
.
Elements for Chapter 3
2
A browser that shows the title and favicon
A head section with a title and a link to a favicon
<head>
<title>San Joaquin Valley Town Hall: � Speakers and Luncheons
</title>
<link rel="shortcut icon" href="images/favicon.ico">
</head>
3
A head section with metadata
<head>
<title>San Joaquin Valley Town Hall: speakers and luncheons
</title>
<meta charset="utf-8">
<meta name="description" content="A yearly lecture � series with speakers that present new � information on a wide range of subjects">
<meta name="keywords" content="san joaquin, � town hall, speakers, lectures, luncheons">
</head>
4
.
Defined: Meta tags (AKA metadata) are HTML snippets used to describe the content on a web page.
SEO guidelines for the <title> tag
5
.
SEO guidelines for Description meta tags
6
Guidelines for heading tags
7
.
<h1>Main Heading</h1>
<h2>Subheading</h2>
<h3>Third level subheading</h3>
<h4>Fourth level subheading</h4>
<h5>Fifth level subheading</h5>
<h6>Sixth level subheading</h6>
HTML block elements (vs. inline)
<h1>San Joaquin Valley Town Hall Programs</h1>
<h2>Pre-lecture coffee at the Saroyan</h2>
<p>Joins us for a complimentary coffee hour, 9:15 to 10:15 a.m. on the day of each lecture. The speakers usually attend this very special event.</p>
<h2>Post-lecture luncheon at the Saroyan</h2>
<p>Extend the excitement of Town Hall by purchasing tickets to the luncheons</p>
8
.
An HTML page with structural elements
<body>
<header>
<h1>San Joaquin Valley Town Hall</h1>
</header>
<main>
<p>Welcome to San Joaquin Valley Town Hall. We have some fascinating speakers for you this season!</p>
</main>
<footer>
<p>© Copyright 2024 San Joaquin Valley Town Hall.</p>
</footer>
</body>
9
.
Accessibility and SEO guideline
Use the HTML structural elements to indicate the structure of your pages. Semantically named to clearly describe meaning to browser and developer.
How to use div elements �to structure the content within a section
<section>
<div>
<h2>The first priority</h2>
<p>The elements for the first priority</p>
</div>
<div>
<h2>The second priority</h2>
<p>The elements for the second priority</p>
</div>
</section>
10
.
Why use structure of section, article, div, etc.?
Examples inline elements
<p>When the dialog box is displayed, enter � <kbd>brock21</kbd>.</p>
<p>To quote Hamlet:
<q>Conscience does make cowards of us all.</q>
</p>
<p>If you don't get 78% or more on your final, � <em>you won't pass.</em></p>
<p>Save a bundle at our <strong>big yearend � sale</strong>.</p>
<p>The chemical symbol for water is H<sub>2</sub>O.</p>
12
.
HTML with block elements and character entities
<p>Ernest Hemingway wrote:</p>
<blockquote>
Cowardice, as distinguished from panic, is almost
always simply a lack of ability to suspend
the functioning of the imagination.
</blockquote>
<address>1-800-221-5528<br>
<a href="emailto:murachbooks@murach.com">
murachbooks@murach.com</a>
</address>
<p>© 2022 Mike Murach & Associates, Inc.</p>
13
.
A simple website folder structure
14
.
Working with URLs and paths
Absolute URLs
http://www.murach.com/index.html
http://www.murach.com/books/php/toc.html
Root-relative paths
/login.html
/images/logo.gif
Document-relative paths that navigate down
images/logo.gif
books/php/overview.html
Document-relative paths that navigate up
../index.html
../images/logo.gif
15
.
Link examples
A link to a web page in the same folder
<p>Go view our <a href="products.html">� product list</a>.</p>
A link to a web page in a subfolder �of the parent folder
<p>Read about the <a href="../company/services.html">� services we provide</a>.</p>
A link to a web page based on the root folder
<p>View your <a href="/orders/cart.html">� shopping cart</a>.</p>
A link to a web page at another website
<p>To learn more about JavaScript, visit the
<a href="http://www.javascript.com/">� official JavaScript web site</a>.</p>
16
.
The link examples in a web browser
SEO and accessibility guideline for links
17
.
HTML that creates two lists
<p>We have books on a variety of languages, including</p>
<ul>
<li>JavaScript</li>
<li>PHP</li>
<li>Java<li>
<li>C#</li>
</ul>
<p>You will need to complete the following steps:</p>
<ol>
<li>Enter your billing information.</li>
<li>Enter your shipping information.</li>
<li>Confirm your order.</li>
</ol>
18
.
The lists in a web browser
19
.
An img element
<img src="images/cougarClyde.png" alt="Clyde Logo" height="275">
<h1>Clyde the Cougar<h1>
The image in a web browser
20
.
Common image formats
Accessibility guidelines for images
21
.
A simple web page
22
.
The HTML file for the web page
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>San Joaquin Valley Town Hall</title>
<link rel="shortcut icon"
href="images/favicon.ico">
</head>
<body>
<header>
<img src="images/logo.jpg" � alt="Town Hall Logo" width="50">
<h2>San Joaquin Valley Town Hall</h2>
<h3>Bringing cutting-edge speakers to the
valley</h3>
</header>
23
.
The HTML file for the web page (continued)
<main>
<h1>This season's guest speakers</h1>
<nav>
<ul>
<li>October:
<a href="speakers/brancaccio.html">
David Brancaccio</a></li>
...
...
</ul>
</nav>
<p><em>Contact us by phone</em> at (559) 555-1212 � for ticket information.</p>
</main>
<footer>
<p>© Copyright 2022 San Joaquin Valley Town � Hall.</p>
</footer>
</body>
</html>
24
.
Short 3-1 Create an HTML page
25
.
Freshtake Presentation for 1 person
Favicon
26