230 likes | 341 Views
HTML 101. 1999 Summer Teacher Training Session New Mexico High School Supercomputing Challenge. What is HTML?. Hypertext Markup Language HTML is a standard for displaying documents on the Internet The foundation of the world wide web. Anatomy of a HTML Page.
E N D
HTML 101 1999 Summer Teacher Training Session New Mexico High School Supercomputing Challenge
What is HTML? • Hypertext Markup Language • HTML is a standard for displaying documents on the Internet • The foundation of the world wide web
Anatomy of a HTML Page • <html> and </html> encapsulates the document’s contents • <head> and </head> encapsulates the header information (meta information, title, etc.) • <body> and </body> encapsulated the actual content of the document.
HTML Tag Format • All tags are in the <tag> and </tag> format. • Tags can have additional attributes inside <>’s. • Most tags have a beginning and ending tag.
Tag Considerations • Tags suggest how the browser is to render the page. • Browsers do not always render tags the same. • An example is the disparity between the Netscape and Microsoft browsers.
<head> Tags • <meta> - used to specify additional information about a document. • <meta> is often used to add keywords for search engines. • <title> - specifies the title of the page. • <title> controls the title-bar in Windows.
Content Tags • Used for creating links and formatting. • <p> defines a paragraph of text. • <br> creates a new line where called. • <p> = <br><br>
Header Tags • Format - <h?>, where ? is between 1 and 6. • Controls size of text. • 1 is the largest, 6 is the smallest • Needs </h?> tag.
<font> Tag • <font> is an alternative to the <h?> tags. • <font> can specify font size, color, alignment and face. • <font color=red face=Arial size=6> is large, red, Arial text.
Emphasis Tags • <b> makes text bold. • <i> makes text italicized. • <u> makes text underlined. • All emphasis tags require ending tags.
<img> Tag • <img> is used to insert an image. • No ending tag is required. • Format: <img src=“location of image file”> • Other attributes can be used to further modify the display of the image.
<hr> Tag • <hr> is used to insert a horizontal rule. • <hr> requires no ending tag. • <hr> inserts a new-line, a rule, and another new-line.
The URL • URL - uniform resource locator • Used to reference and access other Internet resources • URL’s are the foundation of hypertext.
Format of the URL • protocol://computername/path/to/resource
URL Protocols • http - hypertext transfer protocol (WWW) • ftp - file transfer protocol (FTP) • news - Usenet news protocol • nntp - extension of news • javascript - local javascript execution • file - local files on local computer • mailto - used to specify e-mail addresses • telnet - used to open telnet sessions • gopher - used to access gopher resources • And the list goes on...
Creating Hyperlinks • Hyperlinks are used to access URL’s. • Created in HTML pages using the <a> tag. • Example - <a href=http://www.yahoo.com> • Must use </a> tag.
Absolute v. Relative Links • Absolute links have the complete URL specified in <a> tag. • Relative links reference documents relative to current document. • Absolute links eliminate any ambiguity, relative links make relocating pages easier.
The Name and # • Hyperlinks can be created to access a certain part of a document. • The part of the document to be accessed is tagged with an <a name=“somename”> tag. • The reference to the part of the document uses standard <a href> tag with a #. • Example - <a href=#somename>
Lists • There are three types of lists. • Unordered lists use bullets to mark list items (<ul>). • Ordered lists use numbers to mark list items (<ol>). • There are also defined lists that use definitions and names to mark items.
List Elements • <ul> or <ol> start the list. • List items are added using the <li> tags • Lists can be nested. • The list is closed with </ol> or </ul>.
Tables • Tables are the Swiss Army knife of HTML layout. • Tables can be used for many things -- from presenting data to complete document layout.
Three Parts of a Table • <table> and </table> are the starting and ending tags of the table. • <tr> and </tr> starts and ends a table row. • <td> and </td> starts and ends a table definition. • All displayed HTML content is between <td> and </td>.
Example Table <table> <tr><td> Some content goes here… </td></tr> <tr><td> Another row of content. </td></tr> </table>