1. Describe the anatomy of a web page Format the body of a web page with block-level elements...

22
1

Transcript of 1. Describe the anatomy of a web page Format the body of a web page with block-level elements...

Page 1: 1.  Describe the anatomy of a web page  Format the body of a web page with block-level elements including headings, paragraphs, lists, and blockquotes.

1

Page 2: 1.  Describe the anatomy of a web page  Format the body of a web page with block-level elements including headings, paragraphs, lists, and blockquotes.

Describe the anatomy of a web page Format the body of a web page with block-level elements

including headings, paragraphs, lists, and blockquotes Configure the text on a web page with inline elements Configure text with phrase elements Configure special entity characters, line breaks, and

horizontal rules Test a web page for valid HTML syntax

Page 3: 1.  Describe the anatomy of a web page  Format the body of a web page with block-level elements including headings, paragraphs, lists, and blockquotes.

<!doctype html>

<html > an opening tag

.... page info goes here …

</html> a closing tag

Page 4: 1.  Describe the anatomy of a web page  Format the body of a web page with block-level elements including headings, paragraphs, lists, and blockquotes.

Head SectionContains information that describes the web page document <head>…head section info goes here</head>

Body SectionContains text and elements that display in the web page document<body>…body section info goes here</body>

Page 5: 1.  Describe the anatomy of a web page  Format the body of a web page with block-level elements including headings, paragraphs, lists, and blockquotes.

<!doctype html><html lang="en"> <head>

<title>My First Web Page</title> <meta charset="utf-8" > </head> <body> .... Body info goes here …

</body></html>

Page 6: 1.  Describe the anatomy of a web page  Format the body of a web page with block-level elements including headings, paragraphs, lists, and blockquotes.

<h1>Heading Level 1</h1>

<h2>Heading Level 2</h2>

<h3>Heading Level 3</h3>

<h4>Heading Level 4</h4>

<h5>Heading Level 5</h5>

<h6>Heading Level 6</h6>

Page 7: 1.  Describe the anatomy of a web page  Format the body of a web page with block-level elements including headings, paragraphs, lists, and blockquotes.

Paragraph element<p> …paragraph goes here… </p>

› Groups sentences and sections of text together.

› Configures a blank line above and below the paragraph

› Align attribute deprecated in XHTML obsolete in HTML5

Page 8: 1.  Describe the anatomy of a web page  Format the body of a web page with block-level elements including headings, paragraphs, lists, and blockquotes.

Line Break element› Stand-alone tag› Called a void element in HTML5

…text goes here <br>This starts on a new line….

› Causes the next element or text to display on a new line

Page 9: 1.  Describe the anatomy of a web page  Format the body of a web page with block-level elements including headings, paragraphs, lists, and blockquotes.

Horizontal Rule element› Stand-alone tag

<hr >

› Configures a horizontal line on the page

› In HTML5, it should be used to indicate a thematic break at the paragraph level

Page 10: 1.  Describe the anatomy of a web page  Format the body of a web page with block-level elements including headings, paragraphs, lists, and blockquotes.

Blockquote element› Indents a block of text for special emphasis

<blockquote>

…text goes here…

</blockquote>

Page 11: 1.  Describe the anatomy of a web page  Format the body of a web page with block-level elements including headings, paragraphs, lists, and blockquotes.

Indicate the context and meaning of the textDisplay inline with the text

Common Logical Style Tags ◦ <strong></strong>

To cause text to "stand out" from surrounding text. Usually bold.

<strong>This is important</strong>

◦ <em></em> To cause text to be emphasized in relation to other text

on the page. Usually italics.

<em>Please note</em>

Page 12: 1.  Describe the anatomy of a web page  Format the body of a web page with block-level elements including headings, paragraphs, lists, and blockquotes.

Unordered List Description List (XHTML Definition List) Ordered List

Page 13: 1.  Describe the anatomy of a web page  Format the body of a web page with block-level elements including headings, paragraphs, lists, and blockquotes.

Displays information with bullet points Unordered List Element

<ul>Contains the unordered list

List Item Element<li>Contains an item in the list

Page 14: 1.  Describe the anatomy of a web page  Format the body of a web page with block-level elements including headings, paragraphs, lists, and blockquotes.

<ul>

<li>TCP</li>

<li>IP</li>

<li>HTTP</li>

<li>FTP</li>

</ul>

Page 15: 1.  Describe the anatomy of a web page  Format the body of a web page with block-level elements including headings, paragraphs, lists, and blockquotes.

Conveys information in an ordered fashion Ordered List Element

<ol>Contains the ordered list› type attribute determines numbering scheme of

list› default is numerals

List Item Element<li>Contains an item in the list

Page 16: 1.  Describe the anatomy of a web page  Format the body of a web page with block-level elements including headings, paragraphs, lists, and blockquotes.

<ol>

<li>Apply to school</li>

<li>Register for course</li>

<li>Pay tuition</li>

<li>Attend course</li>

</ol>

Page 17: 1.  Describe the anatomy of a web page  Format the body of a web page with block-level elements including headings, paragraphs, lists, and blockquotes.

New name for HTML5 This element was called a Definition List in previous

versions of HTML and XHTML. Uses:

Display a list of terms and descriptions Display a list of FAQ and answers

◦ The Description List element<dl> tagContains the definition list

◦ The dtElement<dt> tagContains a term or nameConfigures a line break above and below the text

◦ The dd Element<dd> tagContains a definition or descriptionIndents the text

Page 18: 1.  Describe the anatomy of a web page  Format the body of a web page with block-level elements including headings, paragraphs, lists, and blockquotes.

<dl>

<dt>IP</dt>

<dd>Internet Protocol</dd>

<dt>TCP</dt>

<dd>Transmission Control Protocol</dd>

</dl>

Page 19: 1.  Describe the anatomy of a web page  Format the body of a web page with block-level elements including headings, paragraphs, lists, and blockquotes.

Display special characters such as quotes, copyright symbol, etc.

Character Code © &copy; < &lt; > &gt; & &amp;

&nbsp;

Page 20: 1.  Describe the anatomy of a web page  Format the body of a web page with block-level elements including headings, paragraphs, lists, and blockquotes.

Purpose: › Configure a specially formatted division or area of

a web page

There is a line break before and after the division.

Can contain other block display and inline display elements

20

Page 21: 1.  Describe the anatomy of a web page  Format the body of a web page with block-level elements including headings, paragraphs, lists, and blockquotes.

Check your code for syntax errors

› Benefit: Valid code

more consistent browser display

W3C XHTML Validation Tool› http://validator.w3.org

Additional HTML5 Validation Tool› http://html5.validator.nu

Page 22: 1.  Describe the anatomy of a web page  Format the body of a web page with block-level elements including headings, paragraphs, lists, and blockquotes.

This chapter provided an introduction to HTML.

HTML elements used for inline and block-level formatting were introduced.

You will use these skills over and over again as you create web pages.