Академический Документы
Профессиональный Документы
Культура Документы
5th Edition
Chapter Nine
Planning Site Navigation
Objectives
When you complete this chapter, you will be able to:
Create usable navigation
Build text-based navigation
Use graphics for navigation and linking
Use lists for navigation
Build horizontal navigation bars
Build vertical navigation bars
Use background color and graphics to enhance
navigation
Create hover rollovers
Web Design Principles 5th Ed.
Where am I?
Where can I go?
How do I get there?
How do I get back to where I started?
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
28
29
31
32
33
34
36
37
38
39
40
Horizontal Navigation
In a standard list, each item is on its own line
To create a horizontal navigation bar using the list,
you need to set the list item display setting to
in-line
This allows the list to display on one line
ul#navlist li{
display: inline;
}
42
43
44
45
46
47
<html>
<head>
<style>
ul#l1 li{
display: inline;
margin: 10px 0px 0px 0px;
border-style:double;
border-color:red;
background-color:yellow;
}
</style>
48
<body>
<ul id="l1">
<li>Home </li>
<li>History</li>
<li>How it works</li>
<li>About</li>
<Li>Interests</li>
<li>Skills</li>
</ul>
</body>
</html>
49
50
51
52
53
55
56
58
Indicating History
Use the link pseudo-classes to show users where
they have been
You can display a graphic based on the state of the
link
In this example, the visited state causes a graphic
check mark to display
59
60
Indicating Location
Location can be indicated by a change in text
weight, text color, or background color or with a
graphic
61
62
a:link { color: white; background-color: black; textdecoration: none; border: 2px solid white; }
a:visited { color: white; background-color: black;
text-decoration: none; border: 2px solid white; }
a:hover { color: black; background-color: white;
text-decoration: none; border: 2px solid black; }
<html>
<head>
<style>
ul#l1 li{
margin: 10px 0px 0px 0px;
border-style:double;
border-color:red;
background-color:yellow;
width:100px;
list-style-type:none;
}
a:link { color: blue; background-color:
black; text-decoration: none; border: 2px
solid white; }
66
68
69
70
ul#navlist a:hover {
color: #fff;
background-color: #0033cc;
font-weight: bold;
}
71
72
73
Underlining on Hover
You can use the hover pseudo-class to turn
underlining on when the user points to a link
a:hover {text-decoration: underline;}
74
75
Hyperlink types
There are three types of hyperlinks:1. Internal: Links to anchors in the current page.
2. It is necessary to mark the location with the help
of <a> tag using name attribute.
3. Then link with the help of href attribute followed by
# symbol.
4. <a href=#top>
<html>
<head>
<title>Delta engineering company</title>
<h1 align =center>Delta Engineering company pvt ltd</h1>
</head>
<body bgcolor="yellow" >
<hr align=left width=100% size=5 color=violet>
<div>
<p>
<a name="top">IDENTIFY METRICS CUSTOMERS
</p>
<p>
Functional Management:
</p></div>
<a href="#top">top</a>
</body></html>
Local
Links to the other pages within your domain or web
site.
<html>
<body>
<a href="list.html">link to a list</a>
<br>
<a href="frame.html">link to a frame</a>
<br>
<a href="img.html">link to an image</a>
</body>
</html>
Global links
Links to domains outside your web site.
<html>
<body>
<a href="list.html">link to a list</a>
<br>
<a href="frame.html">link to a frame</a>
<br>
<a href="img.html">link to an image</a>
<br>
<a href="http://www.google.com">link to Google</a>
</body>
</html>
Anchor tag
The <a> tag can be used in two ways:
To create a link to another document, by using the
href attribute
To create a bookmark inside a document, by using
the name attribute
Target
Value
Description
_blank
_self
_parent
_top
<html>
<body link="red" alink="green" vlink="cyan">
<a href="list.html" target="_blank" accesskey="A">link to a list</a>
<br>
<a href="frame.html" accesskey="B">link to a frame</a>
<br>
<a href="img.html" accesskey="C">link to an image</a>
<br>
<a href="http://www.google.com">link to Google</a>
<br>
<a href="html1.html" > <img src="koala.jpg"></a>
</body>
</html>
author
bookmark
help
Description
Links to an alternate version of the document (i.e. print
page, translated or mirror)
Links to the author of the document
Permanent URL used for bookmarking
Links to a help document
license
next
nofollow
alternate
noreferrer
prev
<html>
<head>
<title>Write title of document.</title>
</head>
<body>
<p>rel attribute of anchor tag in HTML5.</p>
<a rel="nofollow" href="http://www.google.co.in/" >
Do not follow this link.</a><br>
<a rel="alternate" href=ass1.html"
hreflang="en">English version of document</a><br>
<a rel="next" href=frame.html">Open previous document</a
><br>
<a rel="prev" href=img.html">Open next document</a><br>
</body>
</html>
Summary
Usable navigation is the result of working with the
power of hypertext and designing for your users
needs
Work from the users point of view
Make all areas of your Web site quickly accessible
Provide plenty of location cues
Use text-based navigation bars
Use CSS to build attractive horizontal and vertical
navigation bars using simple lists
90
Summary
Use background colors, text colors, and graphics to
enhance navigation
Use the :hover pseudo-class to add interactivity
91