Download presentation
Presentation is loading. Please wait.
Published byBritney Gilmore Modified over 6 years ago
1
Survey of Computer Science CSCI 110, Spring 2011 Lecture 23 HTML
2
The World Wide Web
3
The Client/Server Model
4
Universal Resource Locators
5
The request goes out
6
May I Help You?
7
Browsers
8
Hypertext Markup Language
9
Boiler plate <HTML> <HEAD>
<TITLE>My Home Page</TITLE> </HEAD> <BODY> <H1>Welcome to my homepage!</H1> <P> Hi there! This is my very first web page! </BODY> </HTML> index.html
10
HTML Blocks
11
Adding Graphics
12
Creating Hyperlinks
13
Relative addressing Relative addressing specifies a location relative to the location of the html file. Slashes indicate directory locations: <IMG SRC = "moon.gif"> (moon.gif is in the same directory (folder) as the html file that contains this tag). <IMG SRC = "pictures/cookie.gif"> (cookie.gif is in a directory named pictures that is in the same directory as the html file that contains this tag) index.html moon.gif cookie.gif pictures
14
Absolute Addressing Absolute addressing gives the complete web address of a file: <IMG SRC = " The browser will download the image from the address given in the img tag.
15
Some Common Tags Start a paragraph: <P>
Force a new line: <BR> Bold Text: <B>bold text</B> Italics: <I>Italics</I> Centered Text: <CENTER>Centered text</CENTER> Headlines: <H1>Big Headline</H1> ... <H6>Little headline</H6> Unordered List: <UL> <LI> Item 1 <LI> Item 2 </UL>
16
The FONT Tag The <FONT> tag allows you to specify font types, sizes and colors: Specifying font type: <FONT FACE = "Arial">Arial font</FONT> Specifying font size: <FONT SIZE = 6>A big font</FONT> or: <FONT SIZE = +2>Increase the size a little</FONT> Specifying font color: <FONT COLOR = "red">Red text </FONT>
17
Dealing with White Space
Browsers ignore white space (spaces, tabs, new lines, etc.) Text fills in to the right edge of the browser window, and then the browser wraps the text to the next line. What if you want white space? Option 1: Use to indicate a space Option 2: Use <PRE> ...</PRE> (preformatted text)
18
A Simple Table Holy Cross Boston College WPI 75% 07% 17% <TABLE>
<TR> <TD> Holy Cross </TD> <TD> Boston College</TD> <TD> WPI </TD> </TR> <TD> 75% </TD> <TD> 07%</TD> <TD> 17% </TD> </TABLE> Holy Cross Boston College WPI 75% % %
19
Adding a Border Changing Cell Size
<TABLE BORDER = 2> <TR> <TD> Holy Cross </TD> <TD> Boston College</TD> <TD> WPI </TD> </TR> <TD WIDTH = 120 HEIGHT = 100> 75% </TD> <TD> 07%</TD> <TD> 17% </TD> </TABLE> Holy Cross Boston College WPI 75% % %
20
Changing Alignment Coloring a Cell
Changing Horizontal Alignment: <TD ALIGN = LEFT> <TD ALIGN = CENTER> <TD ALIGN = RIGHT> Changing Vertical Alignment: <TD VALIGN = TOP> <TD VALIGN = MIDDLE> <TD VALIGN = BOTTOM> Coloring a cell: <TD BGCOLOR = BLUE>
21
Inserting Links and Graphics
Inserting a link: <TD><A HREF = " Holy Cross</A></TD> Adding an image: <TD><IMG SRC = "gdome.gif"></TD>
22
Nested Tables <TABLE BORDER = 2> <TR>
<TD>First Cell</TD> <TD><TABLE> <TD>5</TD> <TD>10</TD> </TR> <TD>15</TD> <TD>20</TD> </TABLE> </TD> . . . 15 20
23
Spanning Columns and Rows
Use COLSPAN to span multiple columns: <TR> <TD COLSPAN = 3>Favorite Colleges</TD> </TR> Favorite Colleges Similarly, use ROWSPAN to span multiple rows.
24
Adjusting Table Size Adjusting table width to some number of pixels:
The table will have a width of 500 pixels. Adjusting table width to a percentage of the browser window width: <TABLE WIDTH = 80%> The table will have a width that is 80% of the browser window width.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.