1. Describe the anatomy of a web page Format the body of a web page with block-level elements...
-
Upload
aubrey-hodge -
Category
Documents
-
view
215 -
download
0
Transcript of 1. Describe the anatomy of a web page Format the body of a web page with block-level elements...
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 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
<!doctype html>
<html > an opening tag
.... page info goes here …
</html> a closing tag
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>
<!doctype html><html lang="en"> <head>
<title>My First Web Page</title> <meta charset="utf-8" > </head> <body> .... Body info goes here …
</body></html>
<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>
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
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
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
Blockquote element› Indents a block of text for special emphasis
<blockquote>
…text goes here…
</blockquote>
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>
Unordered List Description List (XHTML Definition List) Ordered List
Displays information with bullet points Unordered List Element
<ul>Contains the unordered list
List Item Element<li>Contains an item in the list
<ul>
<li>TCP</li>
<li>IP</li>
<li>HTTP</li>
<li>FTP</li>
</ul>
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
<ol>
<li>Apply to school</li>
<li>Register for course</li>
<li>Pay tuition</li>
<li>Attend course</li>
</ol>
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
<dl>
<dt>IP</dt>
<dd>Internet Protocol</dd>
<dt>TCP</dt>
<dd>Transmission Control Protocol</dd>
</dl>
Display special characters such as quotes, copyright symbol, etc.
Character Code © © < < > > & &
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
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
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.