HTML 3
HTML 3
HTML 3
Contents
Concepts of Hypertext Versions of HTML Elements of HTML Syntax Head & body sections Building HTML documents Inserting texts, images, Hyperlinks Backgrounds and Colour controls, Different HTML tags Table Layout and presentation Use of front size & Attributes List types and its tags Use of Frames and Forms in web pages.
Concept of Hypertext
Hypertext is the Text which contains links to other text It is one of the major features of the World Wide Web. Hypertext allows us to link information in a way that is not linear like the bound pages of a book, but associative, so that people can choose their own path through the information. Hypertext on the Web makes it possible to link your documents to many resources by other authors in other places. To make hypertext, you create HTML files containing the anchor (A) element.
What is HTML?
HTML stands for Hypertext Markup Language An HTML file is a text file containing markup tags
The markup tags tell the Web browser how to display the page .html is preferred .htm is from very old operating systems that can only handle 8+3 names (eight characters, dot, three characters) Formatted text, such as Microsoft Words .doc files, cannot be used in HTML files
Versions of HTML
XHTML
HTML Elements
Tags are the elements that create the components of a page Tags surrounded by angle brackets < > Usually come in pairs
Stuff between is called element content Tags are not case sensitive
Line Breaks
Character Formatting
Head Section
Tags in head
<HEAD>...</HEAD>-- contains information about the document <TITLE>...</TITLE>-- puts text on the browser's title bar.
Body Section
Tags in Body Heading: <H1> </H1> Center:<Center> </Center> Line Break <P> ,<Br> Phrase Markups: <I></I> ,<B></B>
Create a List
It consists of a <head> and a <body>, in that order The <head> typically contains a <title>, which is used as the title of the browser window Almost all other content goes in the <body>
Hence, a fairly minimal HTML document looks like this: <html> <head> <title>My Title</title> </head> <body> Hello, World! </body> </html>
10
5.Click on File, Open File and select the filename.html document that you just created. 6.Your HTML page should now appear just like any other Web page in Netscape.
7.You may now switch back and forth between the Source and the HTML Document
switch to Notepad with the Document Source make changes save the document again switch back to Netscape click on RELOAD and view the new HTML Document switch to Notepad with the Document Source......
Inserting Images
Images (pictures) are not part of an HTML page; the HTML just tells where to find the image To add an image to a page, use:
<img src="URL" alt="text description" width="150" height="100"> The src attribute is required; the others are optional Attributes may be in any order The URL may refer to any .gif, .jpg, or .png file Other graphic formats are not recognized The alt attribute provides a text representation of the image if the actual image is not downloaded The height and width attributes, if included, will improve the display as the page is being downloaded
Inserting Links
To link to another page, enclose the link text in <a href="URL"> to </a>
Link text will automatically be underlined and blue (or purple if recently visited)
Insert a named anchor: <a name="refs">References</a> And link to it with: <a href="#refs">My references</a>
<a href="PageURL#refs">My references</a>
14
Hexadecimal number : Color names : <Font color=white> Changing the Background color
<BODY BGCOLOR=#19378a>
Spot color
<FONT COLOR=#66ffcc>WENT'99</FONT>
Image Background
HTML Tags
HTML tags are used to mark up HTML elements HTML tags are surrounded by angle brackets, < and > Most HTML tags come in pairs, like <b> and </b> The tags in a pair are the start tag and the end tag The text between the start and end tags is the element content The tags act as containers (they contain the element content), and should be properly nested HTML tags are not case sensitive; <b> means the same as <B>
16
<h1> through <h6> : Headers, from largest to smallest <b> Boldface <i> Italic <p> Paragraph <pre> Preformatted text; preserve spaces and dont wrap lines
17
TD: Table Data TR: Table Row TH: Table Header (Header Cell)
Product.htm
<HTML><HEAD><TITLE> AITC Products </TITLE></HEAD> <BODY>Product Table <TABLE BORDER=3>
<TR><TH>ID</TH> <TH width=150>Name</TH> <TH >Price</TH> <TH>Comment</TH></TR>
<TR><TD>PC100</TD><TD>Compaq Computer</TD><TD align=right>$2,000</TD> <TD><a href="http://www.compaq.com/">Compaq's Web Site</a></TD> </TR> <TR> <TD>TV25</TD> <TD>25 " Sony TV</TD> <TD align=right>$300</TD>
<TD> </TD> </TR>
<TR valign=top> <TD>Pet001</TD> <TD>Little Lion</TD> <TD>$50</TD> <TD><img src="slion.gif"></TD> </TR> <TR><TD colspan=4>10% discount off the list price today</TD></TR> </TABLE> </BODY></HTML>
Lists
Two of the kinds of lists in HTML are ordered, <ol> to </ol>, and unordered, <ul> to </ul> Ordered lists typically use numbers: 1, 2, 3, ... Unordered lists typically use bullets () The elements of a list (either kind) are surrounded by <li> and </li>
Example: The four main food groups are: <ul> <li>Sugar</li> <li>Chips</li> <li>Caffeine</li> <li>Chocolate</li> </ul>
20
Forms
<form> is just another kind of HTML tag HTML forms are used to create (rather primitive) GUIs on Web pages
Usually the purpose is to ask the user for information The information is then sent back to the server
The syntax is: <form parameters> ...form elements... </form> Form elements include: buttons, checkboxes, text fields, radio buttons, drop-down menus, etc
Other kinds of HTML tags can be mixed in with the form elements
A form usually contains a Submit button to send the information in he form elements to the server The forms parameters tell JavaScript how to send the information to the server (there are two different ways it could be sent) Forms can be used for other things, such as a GUI for simple programs
21
The <form arguments> ... </form> tag encloses form elements (and probably other HTML as well) The arguments to form tell what to do with the user input
action="url"
(required) (default)
Specifies where to send the data when the Submit button is clicked
method="get"
Form data is sent as a URL with ?form_data info appended to the end Can be used only if data is all ASCII and not more than 100 characters
Form data is sent in the body of the URL request Cannot be bookmarked by most browsers Tells where to open the page sent as a result of the request target= _blank means open in a new window target= _top means use the same window
22
method="post"
target="target"
HTML FRAMES
With Frames, you can display more than one Web page in the same browser window.
The <frameset> tag defines how to divide the window into frames Each frameset defines a set of rows or columns The values of the rows/columns indicate the amount of screen area each row/column will occupy <frameset cols=25%,75%> <frame src=frame_a.htm> <frame src=frame_b.htm> </frameset>
The End
25