160 likes | 363 Views
Introduction to HTML. CPS470 Software Engineering Fall 1998. Objectives. Learn how to create a simple web page: HTML documents. Necessary parts of an HTML document. Common HTML tags. Creating lists. Linking and graphics. Display a text file as-is. HTML Document.
E N D
Introduction to HTML CPS470 Software Engineering Fall 1998
Objectives • Learn how to create a simple web page: • HTML documents. • Necessary parts of an HTML document. • Common HTML tags. • Creating lists. • Linking and graphics. • Display a text file as-is. CPS 470 Software Engineering
HTML Document • HyperText Markup Language (HTML). • HTML files are plain text files that can be created using any test editor and viewed by web browsers. • HTML document contains different sections: head, title, body, paragraphs, lists, etc. • Tags are used to denote the components of an HTML document. CPS 470 Software Engineering
HTML Tags Overview • <tag-name> • Tags are normally paired to signify the start and end of the tag instruction (section): <tag-name> • Some start tags may include additional information or attributes. Ex: <P ALIGN = CENTER> A paragraph tag </P> CPS 470 Software Engineering
Basic Tags • An HTML document must have these elements: Type: <HTML> </HTML> (beginning and end of file) Title: <TITLE> </TITLE> (in header) Header: <HEAD> </HEAD> (descriptive information) Body: <BODY> </BODY> (body of the page) CPS 470 Software Engineering
Minimal HTML Document <HTML> <HEAD> <TITLE>Template</TITLE> </HEAD> <BODY> <H1> Template </H1> <P> This is a template! </P> </BODY> </HTML> CPS 470 Software Engineering
Common Tags Appearing in the Body Heading: <H?></H?> (? = 1,2,…,6) Align Heading <H? ALIGN=LEFT|CENTER|RIGHT></H?> Paragraph <P></P> Author's Address <ADDRESS></ADDRESS> Large Font Size <BIG></BIG> Small Font Size <SMALL></SMALL> Bold <B></B> Italic <I></I> Center <CENTER></CENTER> (text and images) Line Break <BR> CPS 470 Software Engineering
List Tags Unordered list: <UL> <LI></UL> (unnumbered list) Ordered list: <OL> <LI></OL> (numbered list) Definition list: <DL> <DT><DD></DL> (DT=term, DD=definition) Example: <UL> <LI> Item 1 <LI> Item 2 </UL> Lists can be nested. CPS 470 Software Engineering
Links and Images Link URL: <A HREF= “URL”>text</A> Display image: <IMG SRC=“URL”> Example: <A HREF=“http://www.cse.msu.edu/~cps470> CPS470 </A> <IMG SRC=“./image.gif”> CPS 470 Software Engineering
Preformatted Text Preformatted text: <PRE>text</PRE> (displays text as-is) Example: <PRE> #include<iostream.h> int main(void) { cout <<“testing preformatted text”<<endl; } </PRE> CPS 470 Software Engineering