130 likes | 141 Vues
Learn about the HTML elements and how to structure documents using headings, white space, links, inline images, color, lists, and tables.
E N D
chapter4 An HTML v4.1 Primer xhtml is “v5.0”
HTML Elements Table 4.1 • html elements • container elements • <h2> text </h2> -- open tag, close tag • empty elements • <hr> --no close tag • Elements for Bold and Italic (deprecated) • <b> .. </b> • <i> .. </i>
web page structure <html> <head><title>I’d rather be ..</title> </head> <body> <h1> I’d rather be ...</h1> <h2> … skiing!!! </h2> <hr> <img src="ski.jpg"> </body> </html>
STRUCTURING DOCUMENTS • Headings in HTML • h1, h2, …, h6 • HTML Format vs. Display Format: White Space • Attributes in HTML • <p align=“center”> … </p> • <body text=“navy” bgcolor=“ivory”> …
white space in html <h3>White Space in HTML</h3> Any sequence of white-space characters is rendered as a single space. <br> For example, here is one space: and here are five spaces: How are they rendered by your browser? Solutions: <pre> .. </pre>
MARKING LINKS WITH ANCHOR TAGS • Two Sides of a Link • href + anchor text • Absolute Pathnames (URLs) • <a href=http://www.uoregon.edu> UO </a> • Relative Pathnames • <a href=“contact.html”> Contact Info </a>
Inline Images <img src=“pipe.jpg” width=“250” height=“150” alt=“pipe.jpg” > (eg) ski.html .gif, .jpg, .png image formats
Inline Images: Alignment <img src=“jwocky.jpg” width=“250” height=“150” alt=“jabberwocky.jpg” > Attribute: align Values for wrapping text around images: left, right (but no center) align=“left” image aligns to the left, text flows around the right side of the image align=“right” image aligns to the right, text flows around the left side of the image
Inline Images: Alignment • Jabberwocky w/image & text wrap • Jabberwocky in Wikipedia • Jabberwocky in Klingon • Other Translations align attribute is deprecated in html 4.01 use CSS float attribute
HANDLING COLOR Colors by Name (140 ttl) or Number • CSS Standard Color names (16) • extended color names (124) • introduced by Netscape & supported by all modern browsers • hex triples: chartreuse = #7FFF00 beige #F5F5DC
HANDLING LISTS W3Schools: HTML Lists
HANDLING TABLES W3Schools: Tables
Next:XHTML ?=? HTML v5.0 W3Schools: XHTML