Professional Documents
Culture Documents
Lecture 25- 29
Introduction to HTML
Contents Getting Started.. What is HTML? How to create and View an HTML document? Basic HTML Document Format The HTML Basic tags
What is HTML?
4 Telling the browser what to do, and what props to use. 4 A serises of tags that are integrated into a text document. Tags are ; 4 surrounded with angle brackets like this
* <B> or <I>.
4 The first tag turns the action on, and the second turns it off.
4 Some browsers don't support the some tags and some attributes.
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......
Tags in head
<HEAD>...</HEAD>-- contains information about the document <TITLE>...</TITLE>-- puts text on the browser's title bar.
10
Tags in Body Let's talk Text Heading: <H1> </H1> Center:<Center> </Center> Line Break <P> ,<Br> Phrase Markups: <I></I> ,<B></B> Create a List Unordered list : <UL><li> Ordered list: <OL><li> Nested
11
Add Images Use <IMG SRC=imagefilename> tags How to specify Relative pathnames Attributes of IMG tag
-width,height -Alt -Align -<Img src=my.gif width=50 height=50 align=right alt=My image>
12
Add some Link Use <A href=filename|URL></a>tags How to specify Relative pathnames Kinds of URLs
-http://www.women.or.kr - ftp://ftp.foo.com/home/foo - gopher://gopher.myhost.com/ - news://news.nuri.net - mailto:skrhee@women.or.kr
13
How to make colors changes? Hexadecimal number : Color names : <Font color=white> Changing the Background color
<BODY BGCOLOR=#19378a>
Spot color
<FONT COLOR=#66ffcc>WENT'99</FONT>
Image Background
<p> for paragraphs, can contain inline elements, but no block-level elements
line wrapping is done automatically white space (tabs, spaces, returns) is normally ignored
must be specified using specific tags
<br /> for line breaks for single space between two words that must be kept together on the same line
Lists
Block-level elements:
Unordered list (bulleted): <ul> Ordered list (numbered): <ol>
Both <ul> & <ol> have list items, <li>, for each element in a list
Lists are formed according to hierarchical nesting All list tags require opening & closing tags with proper nesting
How would you get the following list? <ul> <li>East <ol> <li>Yankees</li> <li>Red Sox</li> <li>Orioles</li> </ol> <li>Central</li> <li>West</li> </ul>
Quick review of HTML block structures: lists and tables Ordered Lists
Unordered Lists
Hyperlinks
Inline element, must have 2 tags
<a href= specify clickable links to other Web or local documents
Local Hyperlinks
Use relative reference rather than absolute reference
Relative to where the document with the link is ../ means in the directory above the current file ./ means in the same directory as the current file Relative Reference <p><a href="./lectures/XHTML.ppt">
XHTML.ppt </a></p>
Absolute Reference
Organizing your own site images Place all images inside an images directory
Be sure to do this for all assignments
Inside your Web pages, you may then reference the images using src="./images/ " When you upload your Web pages, upload your entire images directory
Save the following file to an images directory and correct the URLs accordingly
http://www.du.edu/~jcalvert/hist/wh9j.jpg
Images
To display an image alone in a browser you may use the a tag.: <p><a href="http://www.du.edu/~jcalvert/hist/wh9j.jpg"> William Henry Harrison</a></p> To display an inline image within a page, use img: <img src="URL" width=" " height=" " alt=" " longdesc= " "> URL points to a GIF, JPEG, or PNG img may be placed in any block-level or inline element except pre You should always include alt <img src="http://www.du.edu/~jcalvert/hist/wh9j.jpg" width="500" height="200" alt="An elongated William Henry Harrison" >
By default, table cells are drawn of minimum height and width to accommodate the contents of the cells.
Properties of the whole table can be formatted using attributes of the table element.
bgcolor
(background color)
inherited from bgcolor of underlying Web page 0 browser dependent (about 1) browser dependent (about 2) minimum to accommodate table contents minimum to accommodate table contents
<td ></td> (t
ATTRI alig TE
d t
Us d on
insid
tr
m nt
backgro
(background image)
bgcolor
(background color)
cols a ro s a eig t i t
inherited from bgcolor of table containing the cell 0 0 minimum to accommodate cell contents minimum to accommodate cell contents
To create "irregular" tables, use the rowspa and olspa attributes of the td element.
The spanning is always to the right and down. Notice which td elements are eliminated.