Professional Documents
Culture Documents
Info 600 Intro HTML 2
Info 600 Intro HTML 2
Info 600 Intro HTML 2
|2
The Internet and the Web
3
The Internet
• Internet: A Network of Networks
4
The Internet
5
More at: http://www.opte.org/maps/
The Web and basic concepts
• The Web is part of the Internet
– Transmits data about web documents
• URL: Uniform Resource Locator
– The address of a Web page/document
• (X)HTML: (eXtensible) Hypertext Markup Language
– The language to author Web pages
• Hyperlink: a references to a document on the Web
– A URL with anchor text (label)
– Anchor text: label of a hyperlink reference
URL: http://www.ischool.drexel.edu/faculty/wke Anchor text: Instructor’s Home Page
A hyperlink
6
Size of the Web
• Number of Web Sites:
– 1991: August 6, Tim Berners-Lee published the Web
– 1994: 700 - 12,000 web sites
– 1991-1997: Explosive growth, at a rate of 850% per year.
– 1998-2001: Rapid growth, at a rate of 150% per year.
– 2002-2006: Maturing growth, at a rate of 25% per year.
– 2007: over 100 million web sites
– 2010: about 200 million web sites (predicted)
http://www.useit.com/alertbox/web-growth.html
7
Size of the Web
• Number of Web Pages:
– 1991: first pages on the web
– 1997: 200 million pages
– 1998: 800 million pages
– 2005: 11.5 billion pages
– 2007: 22.5 billion pages
– 2010: trillion+ pages
– ++ dynamic pages, (micro) blogs, facebook, …
–…
8
WEB BROWSER/SERVER
9
Client/Server Architecture
• Client
– “a person served by or utilizing the services of (e.g., a
social agency)”
– a computer in a network that uses the services (as access
to files or shared peripherals) provided by a server
• Server
– “one that serves (e.g., food or drink)”
– a computer in a network that is used to provide services
(as access to files or shared peripherals or the routing of e-
mail) to other computers in the network
http://www.merriam-webster.com/dictionary
10
Client/Server Interaction
• One server serves multiple clients
• SERVER NETWORK CLIENT
• Typical interaction:
– A CLIENT sends some REQUEST to a SERVER
– SERVER receives it and RESPONDS (do something)
– SERVER sends results back to CLIENT
11
Web Browser vs. Web Server
• Browser/Server is Client/Server
• Browser: client to be served with web content
– e.g, Firefox browser on your personal computer
• Web server: to serve web content (pages)
– e.g., www.drexel.edu server provides web pages about
Drexel University
• How do they communicate?
• What happens when you type in a URL or click on a
hyperlink?
– e.g., http://www.drexel.edu/about/mission.aspx
12
Browser / Server Communication
• What happens after you type in the URL?
13
Browser/Server Communication
• Parts of a URL (Uniform Resource Locator)
• http://www.drexel.edu/about/mission.aspx
– Protocol: HTTP, or Hypertext Transfer Protocol
• Other protocols: HTTPS (secure), FTP (File Transfer
Protocol), SFTP (Secure FTP), etc.
– Host: www.drexel.edu
– Path: /about/
– File: mission.aspx
• Syntax:
[PROTOCOL]://[HOST]:[PORT]/[PATH]/[FILE]
– http://www.drexel.edu:80/about/mission.aspx 14
Browser/Server Communication
• http://www.drexel.edu/about/mission.aspx
/about/mission.aspx 15
HTML: HyperText Markup Language
16
What is HTML?
20
HTML Basic Syntax
• Correct Syntax: 2 and 3 are equivalent if there is no content
1. <element1 attribute1="value">content</element1>
2. <element1 attribute1="value"></element1>
3. <element1 attribute1="value" />
• Embedded (parent/child/grandchild/etc.):
<element1 attribute1="value">
<element2 attribute1="value”>
<element3 …>…</element3>
</element2>
</element1>
21
Basic HTML Tags/Elements
• Required Elements in an HTML page
<!DOCTYPE html>
<html>
<head>
<meta charset=“utf-8” />
<title>Title to be Shown on Browser Topbar</title>
</head>
<body>
.... Everything else to be shown on the page goes here
</body>
</html>
22
Details on a few HTML tags
23
HTML Root Tag
• Root element of an
24
Head & Body Sections
• Head Section
Contains information that describes the web page
document
<head>
…head section info goes here
</head>
• Body Section
Contains text and elements that display in the Web
page document
<body>
…body section info goes here
</body>
meta Elements
• Within the head section
• Specify information about the web document
• Provide information for search engine cataloging
<meta name="keywords" content=”web page, design,
education,..." />
• Paragraph element
<p> …paragraph content… </p>
– Groups sentences and sections of text together.
– Configures a blank line above and below the
paragraph
29
HTML <a> tag
• Absolute link
– Link to other Web sites
<a href="http://yahoo.com">Yahoo</a>
• Relative link
– Link to pages on your own site
30
HTML Email Links using the <a> tag
31
Inserting an Image
• The Image Tag:
<img src=“image.jpg” alt=“My Picture” />
– This assumes that the file image.jpg is in the same
directory as the XHTML file that contains it.
– alt attribute to provide alternate text when the image does
not show on the device
– If the image file is somewhere else in your directories,
supply the path relative to your HTML file:
<img src=“../images/image.jpg” alt=“My picture
in the parent/upper directory” />
Use image as a link
• Use <img> tag within <a> tag
– In this case, <a> is a parent of <img>
– Or, <img> is a child of <a>
• Clicking on the image opens the link
• Example:
<a href="http://www.amazon.com/…">
<img src="bookcover.gif" alt="a good book" />
</a>
33
HTML Ordered List
<ol>
<li>Apply to school</li>
<li>Register for course</li>
<li>Pay tuition</li>
<li>Attend course</li>
</ol>
HTML Unordered List
<div id=“nav”>
Navigation section of the page
</div>
Adding Comments
• Always a good idea to add comments to remind
yourself or someone else later.
• Comments
– begin with <!--
– end with -->
<!--
Here is a table of contents
-->
<div id="toc">Antoni Guadi<br/>La Casa
Mila<br/>La Sagrada Famila</div>
Internal Linking
• The <a> tag can be used to link to another section of
the same document by specifying the element’s id
as the link’s href.
• To link internally to an element with its id attribute
set, use the syntax #id.
– First, define an element’s id, for example:
<h1 id="conclusion">Conclusion</h1>
– Then, add a link to it by referencing the id, for example:
<a href=”#conclusion”>Go to Conclusion</a>
39
HTML Validation
40
HTML Validation
• To include the validator link in your page:
<a href="http://validator.w3.org/check?uri=referer">
<img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid
XHTML 1.0 Transitional" height="31" width="88" />
</a>
– Yes, this is an XHTML validator which works for
HTML 5 as well.
– Shows the following validation icon & link:
– Clicking on the icon takes you to validation of the
current page
41
Resources
42