tutorial 2 developing a web site

41
Tutorial 2 Developing a Web Site

Upload: joey

Post on 04-Feb-2016

42 views

Category:

Documents


1 download

DESCRIPTION

Tutorial 2 Developing a Web Site. Objectives. Learn how to storyboard various Web site structures Create links among documents in a Web site Understand relative and absolute folder paths Work with the base element Mark a location with the id attribute Create a link to an id - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Tutorial 2 Developing a Web Site

Tutorial 2Developing a Web

Site

Page 2: Tutorial 2 Developing a Web Site

XPXPXPXPXPObjectives• Learn how to storyboard various Web site

structures• Create links among documents in a Web site• Understand relative and absolute folder paths• Work with the base element• Mark a location with the id attribute• Create a link to an id• Mark an image as a link

New Perspectives on HTML and XHTML, Comprehensive 2

Page 3: Tutorial 2 Developing a Web Site

XPXPXPXPXPObjectives• Create an image map from an inline image• Remove an image border• Understand URLs• Link to a site on the Web• Link to an FTP site• Link to an e-mail address• Work with hypertext attributes• Work with metadata

New Perspectives on HTML and XHTML, Comprehensive 3

Page 4: Tutorial 2 Developing a Web Site

XPXPXPXPXPWorking with Web Site Structures• A storyboard is a diagram of a Web site’s structure,

showing all the pages in the site and indicating how they are linked together

• It is important to storyboard your Web site before you start creating your pages in order to determine which structure works best for the type of information the site contains

• A well-designed structure can ensure that users will be able to navigate the site without getting lost or missing important information

New Perspectives on HTML and XHTML, Comprehensive 4

Page 5: Tutorial 2 Developing a Web Site

XPXPXPXPXPLinear Structures

• In a linear structure, each page is linked with the pages that follow and precede it in an ordered chain

• Linear structure works best for Web pages with a clearly defined order

• In an augmented linear structure, each page contains an additional link back to an opening page

New Perspectives on HTML and XHTML, Comprehensive 5

Page 6: Tutorial 2 Developing a Web Site

XPXPXPXPXPLinear Structures

New Perspectives on HTML and XHTML, Comprehensive 6

A linear structure

An augmented linear structure

Page 7: Tutorial 2 Developing a Web Site

XPXPXPXPXPHierarchical Structures• In the hierarchical structure, the pages are linked

going from the home page down to more specific pages

• Users can easily move from general to specific and back again

• Within this structure, a user can move quickly to a specific scene within the page, bypassing the need to move through each scene in the play

New Perspectives on HTML and XHTML, Comprehensive 7

Page 8: Tutorial 2 Developing a Web Site

XPXPXPXPXPHierarchical Structures

New Perspectives on HTML and XHTML, Comprehensive 8

Page 9: Tutorial 2 Developing a Web Site

XPXPXPXPXPMixed Structures• As Web sites become larger and more complex,

you often need to use a combination of several different structures

• The overall form can be hierarchical, allowing the user to move from general to specific; however, the links also allow users to move through the site in a linear fashion

• A site index is a page containing an outline of the entire site and its contents

New Perspectives on HTML and XHTML, Comprehensive 9

Page 10: Tutorial 2 Developing a Web Site

XPXPXPXPXPMixed Structures

New Perspectives on HTML and XHTML, Comprehensive 10

Page 11: Tutorial 2 Developing a Web Site

XPXPXPXPXPWeb Site with No Coherent Structure

New Perspectives on HTML and XHTML, Comprehensive 11

Page 12: Tutorial 2 Developing a Web Site

XPXPXPXPXPProtected Web Site Structures• Sections of most commercial Web sites are off-

limits except to subscribers and registered customers

New Perspectives on HTML and XHTML, Comprehensive 12

Page 13: Tutorial 2 Developing a Web Site

XPXPXPXPXPCreating a Hypertext Link

New Perspectives on HTML and XHTML, Comprehensive 13

Page 14: Tutorial 2 Developing a Web Site

XPXPXPXPXPCreating a Hypertext Link• To link to a page, you specify the name of the file using

the href attribute of the <a> tag (anchor tag)– <a href = “reference” > content </a>

• Where reference is the location being linked to and content is the document content that is being marked as a link.

• For example:– < a href = “home.htm” > Home </a>– The word “Home” will be underlined, providing a visual clue to

the user that the text is linked to another document (home.htm)

New Perspectives on HTML and XHTML, Comprehensive 14

Page 15: Tutorial 2 Developing a Web Site

XPXPXPXPXPCreating a Hypertext Link• Filenames are case sensitive on some operating

systems, including the UNIX and Macintosh, but not on others

• The current standard is to use lowercase filenames for all files on a Website and to avoid special characters such as blanks and slashes

• You should also keep filenames short to avoid typing errors

New Perspectives on HTML and XHTML, Comprehensive 15

Page 16: Tutorial 2 Developing a Web Site

XPXPXPXPXPCreating Hypertext Links

New Perspectives on HTML and XHTML, Comprehensive 16

Page 17: Tutorial 2 Developing a Web Site

XPXPXPXPXPSpecifying a Folder Path

New Perspectives on HTML and XHTML, Comprehensive 17

Page 18: Tutorial 2 Developing a Web Site

XPXPXPXPXPSpecifying a Folder Path

• To create a link to a file located in a different folder than the current document, you must specify the file’s location, or path

• HTML supports two kinds of paths: absolute and relative.

New Perspectives on HTML and XHTML, Comprehensive 18

Page 19: Tutorial 2 Developing a Web Site

XPXPXPXPXPLinking to Documents in Other FoldersAn absolute path specifies a file’s precise location within a computer’s entire folder structure.Syntax of an absolute path:

/folder1/folder2/folder3/fileWhere folder1 is the topmost folder in the computer’s

folder tree, followed by folder2, folder3, and so forth.

New Perspectives on HTML and XHTML, Comprehensive 19

Page 20: Tutorial 2 Developing a Web Site

XPXPXPXPXPAbsolute Paths

<a href="/Users/Toshiba/Desktop/tips/tip.htm" >tip1</a>

New Perspectives on HTML and XHTML, Comprehensive 20

Page 21: Tutorial 2 Developing a Web Site

XPXPXPXPXPAbsolute Paths

If files are located on different drives as well as in different folders, you must include the driver letter in the form

/drive|/folder1/folder2/folder3/fileFor example

/C|/cameshots/pages/tips/tips1.html

Note:The drive letter C does NOT have to be included if the documents are located on the same hard drive

New Perspectives on HTML and XHTML, Comprehensive 21

Page 22: Tutorial 2 Developing a Web Site

XPXPXPXPXPRelative Paths

• A relative path specifies a file’s location in relation to the location of the current document.

• If the file is in the same location as the current document, you do not have to specify the folder name.

• If the file is in a subfolder of the current document, you have to include the name of the subfolder

folder/file

New Perspectives on HTML and XHTML, Comprehensive 22

Page 23: Tutorial 2 Developing a Web Site

XPXPXPXPXPRelative Paths

<a href="tips/tip.htm" >tip1</a>

New Perspectives on HTML and XHTML, Comprehensive 23

Page 24: Tutorial 2 Developing a Web Site

XPXPXPXPXPRelative Paths• If you want to go one level up the folder tree, you start

the relative path with a double period (..) and then provide the name of the file.

../file• To specify a different folder on the same level, known as

a sibling folder, you move up the folder tree using the double period (..) and then down the tree using the name of the sibling folder.

../folder/file• You should almost always use relative paths in

your links.

New Perspectives on HTML and XHTML, Comprehensive 24

Page 25: Tutorial 2 Developing a Web Site

XPXPXPXPXPSpecifying a Folder Path

New Perspectives on HTML and XHTML, Comprehensive 25

Page 26: Tutorial 2 Developing a Web Site

XPXPXPXPXPLinking to Locations within

Documents• To jump to a specific location within a document,

you first need to mark that location• One way to identify elements in an HTML

document is to use the id attribute• The id element uses the syntax: id=“id ” where id is the id name assigned to

the element.<h2 id=“H”>H</h2>

New Perspectives on HTML and XHTML, Comprehensive 26

Page 27: Tutorial 2 Developing a Web Site

XPXPXPXPXPUsing the id Attribute• Id names must be unique, if you assign the same

id to more than one element on your Web page, the browser uses the first occurrence of the id name.

• Id names are not case sensitive.

New Perspectives on HTML and XHTML, Comprehensive 27

Page 28: Tutorial 2 Developing a Web Site

XPXPXPXPXPLinking to an id• Once you’ve marked an element using the id

attribute, you can create a hypertext link to that element using the hypertext link

<a href = “#id”>content </a>For example to create a link to h2 heading for the

letter A in the glossary document, you would enter the following code:

<a href=“#A”>A</a>

New Perspectives on HTML and XHTML, Comprehensive 28

Page 29: Tutorial 2 Developing a Web Site

XPXPXPXPXPUsing the id Attribute for glossary.htm

<h1 style="color: blue">Glossary</h1> <p> [<a href="#A">A</a>] [<a href="#B">B</a>] [<a href="#C">C</a>] [<a href="#D">D</a>] [<a href="#E">E</a>] [<a href="#F">F</a>] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] [Z] </p>

New Perspectives on HTML and XHTML, Comprehensive 29

Page 30: Tutorial 2 Developing a Web Site

XPXPXPXPXPLinking to Locations within Documents

New Perspectives on HTML and XHTML, Comprehensive 30

Page 31: Tutorial 2 Developing a Web Site

XPXPXPXPXPThe id Attribute (top of page)• Use the id attribute to mark the top of the page<body> <div id="top"> <img src="camshots.jpg" alt="CAMshots" /> </div>… etc. …. Much more follows …<hr /> <div><a href="#top">Return to Top</a> &#8657;</div> <hr /> <address> CAMshots &#8250;&#8250;&#8250; Advice and News from the World of Digital

Photography by Patrick Healy </address></body></html>

New Perspectives on HTML and XHTML, Comprehensive 31

Page 32: Tutorial 2 Developing a Web Site

XPXPXPXPXPCreating Links between Documents• To create a link to a specific location in another

file, enter the code<a href="reference#id">content</a>

where reference is a reference to an HTML or XHTML file and id is the id of an element marked within that file

<a href =“glossary.htm#D>”D” terms in the Glossary</a>

New Perspectives on HTML and XHTML, Comprehensive 32

Page 33: Tutorial 2 Developing a Web Site

XPXPXPXPXPCreating Links between Documents

New Perspectives on HTML and XHTML, Comprehensive 33

Page 34: Tutorial 2 Developing a Web Site

XPXPXPXPXPWorking with Linked Images & Image Maps

• A standard practice on the Web is to turn the Web site’s logo into a hypertext link pointing to the home page<a href="reference"><img src="file" alt="text" /></a>

• HTML also allows you to divide an image into different zones, or hotspots, each linked to a different destination

New Perspectives on HTML and XHTML, Comprehensive 34

Page 35: Tutorial 2 Developing a Web Site

XPXPXPXPXPWorking with Linked Images & Image Maps

New Perspectives on HTML and XHTML, Comprehensive 35

Page 36: Tutorial 2 Developing a Web Site

XPXPXPXPXPRemoving the border from an inline

image• To remove a border from an inline image, add

the following attribute to the <img> tag:style = “border-width:0”

• Example:• <img src="camshots.jpg" alt="CAMshots"

style="border-width: 0" />

New Perspectives on HTML and XHTML, Comprehensive 36

Page 37: Tutorial 2 Developing a Web Site

XPXPXPXPXPIntroducing URLs• To create a link to a resource on the Internet, you

need to know its URL• A Uniform Resource Locator (URL) specifies the

precise location of a resource on the Internet• A protocol is a set of rules defining how

information is exchanged between two resources

New Perspectives on HTML and XHTML, Comprehensive 37

Page 38: Tutorial 2 Developing a Web Site

XPXPXPXPXPIntroducing URLs• Your Web browser communicates with Web

servers using the Hypertext Transfer Protocol (HTTP)

• The URLs for all Web pages must start with the scheme “http”

• Other Internet resources use different protocols and have different scheme names

New Perspectives on HTML and XHTML, Comprehensive 38

Page 39: Tutorial 2 Developing a Web Site

XPXPXPXPXPLinking to a Web Site

New Perspectives on HTML and XHTML, Comprehensive 39

To create a link to a Web site from your document, use the URL of the Web site as the value of the href attribute.<a href="http://www.apogeephoto.com">Apogee Photo</a>

Page 40: Tutorial 2 Developing a Web Site

XPXPXPXPXPLinking to an E-Mail Address

To create a hypertext link to an e-mail address, use the following syntax:

<a href="mailto:address">content</a>

Exampel:<a href="mailto :[email protected]">E-mail us</a>

New Perspectives on HTML and XHTML, Comprehensive 40

Page 41: Tutorial 2 Developing a Web Site

XPXPXPXPXPTutorial- 2 Summary• Create a Web site with several linked pages• Storyboarding and complex Web structures• Creating Web pages linked together• Links to locations within documents and from

another document• Inline images and image maps

New Perspectives on HTML and XHTML, Comprehensive 41