|
Web Design ![]() This website demonstrates using wikis as teaching and learning tool. The course instructor is happy to share the teaching materials here with those who find it readable. |
Lecture /
Links and NavigationA Web Design Lecture by Steven Choy Overview: The importance of hyperlink design - Hyperlink States - Popular CSS Properties for Styling Hyperlinks - Adding image links - Adding a navigation bar - Why be conventional? - Navigation on large sites - Using a drop-down menu - Breadcrumb trails - Adding a site search - Adding a sitemap
The Importance of Hyperlink Design
<a href="http://www.stepwise.hk/blog/" title="Stepwise Internet Solutions">
<img src="stepwise-logo.png" alt="Stepwise Blog" />
</a>
Types of Hyperlink
Hyperlink States
1) a:link – this is the normal state of a hyperlink
2) a:visited – this is when the link has been visited before
3) a:hover – this is when the user hovers their mouse over a link
4) a:active – this is when the user clicks on the link (or presses the Enter key on a focused link)
5) a:focus – this is when the user uses the Tab key to navigate to hyperlinks
Popular CSS Properties for Styling Hyperlinks
Hyperlink Design Best PracticesReference: Designing Hyperlinks: Tips and Best Practices
<div id="nav-menu">
<ul class="menu">
<li class="first">
<a href="index.html" class="current"><span>Home</span></a>
</li>
<li>
<a href="services.html" ><span>Services</span></a>
</li>
<li>
<a href="portfolio.html"><span>Portfolio</span></a>
</li>
<li>
<a href="about.html"><span>About us</span></a>
</li>
<li class="last">
<a href="contact.html" ><span>Contact us</span></a>
</li>
</ul>
</div>
a { color: #0060ff; text-decoration: underline; }
a:visited { color: #333; text-decoration: underline; }
a:hover { color: #df0000; text-decoration: underline; }
Using images to make or decorate hyperlinks
Method 1) Put a normal image inside a link
<a href="/pluiplui/">
<img src="/pictures/logo.gif" alt="Plui Plui Logo" />
</a>
Method 2) Use a background image to the link itself, using CSS
HTML code:
<a href="http://xavisys.com" title="Professional WordPress Development" id="xavisys-logo">
Xavisys Website Development
</a>
CSS code:
#xavisys-logo {
background-image:url(/wp-content/uploads/2009/11/email_logo.gif);
display:block;
height:58px;
text-indent:-9999px;
width:200px;
}
Another example: HTML and CSS
HTML Code:
<div id="main">
<div id="header">
<a href="/" title="Home"><h1>Title</h1></a>
</div>
<div id="body">Body</div>
<div id="footer">Footer</div>
</div>
CSS Code:
#header
{
background: url(logoExample.jpg);
width: 180px;
height: 135px;
position: relative;
}
#header a
{
position: absolute;
top: 0;
left: 0;
width: 180px;
height: 135px;
}
#header a h1
{
display: none;
}
HTML Code:
<ul id="nav">
<li id="work"><a href="work.php">Work</a></li>
<li id="about"><a href="#aboutme">About</a></li>
<li id="blog"><a href="http://blog.mattdempsey.com">Blog</a></li>
<li id="contact"><a href="#contactme">Contact</a></li>
<li id="twitter"><a href="http://www.twitter.com/mattdempseycom">Twitter</a></li>
</ul>
CSS Code:
li#work a{
background: url(../images/nav-work.png) 0 0 no-repeat;
display: block;
height: 50px;
width: 87px;
text-indent: -100000px;
}
li#work a:hover{
background: url(../images/nav-work.png) 0 -50px no-repeat;
}
li#about a{
background: url(../images/nav-about.png) 0 0 no-repeat;
display: block;
height: 50px;
width: 100px;
text-indent: -100000px;
}
li#about a:hover{
background: url(../images/nav-about.png) 0 -50px no-repeat;
}
Navigation DesignAdding a navigation bar
Navigation on large sites
1) Provide a good site search function
2) Provide many levels of navigation (e.g. drop down menu)
3) Provide a "related links" section
4) Provide an advanced search function
Using a drop-down menu
<ul id="menu"> <li><a href="">Home</a></li> <li><a href="">About Us</a> <ul> <li><a href="">The Team</a></li> <li><a href="">History</a></li> <li><a href="">Vision</a></li> </ul> </li> <li><a href="">Products</a> <ul> <li><a href="">Cozy Couch</a></li> <li><a href="">Great Table</a></li> <li><a href="">Small Chair</a></li> <li><a href="">Shiny Shelf</a></li> <li><a href="">Invisible Nothing</a></li> </ul> </li> <li><a href="">Contact</a> <ul> <li><a href="">Online</a></li> <li><a href="">Right Here</a></li> <li><a href="">Somewhere Else</a></li> </ul> </li> </ul>
ul { font-family: Arial, Verdana; font-size: 14px; margin: 0; padding: 0; list-style: none; } ul li { display: block; position: relative; float: left; } li ul { display: none; } ul li a { display: block; text-decoration: none; color: #ffffff; border-top: 1px solid #ffffff; padding: 5px 15px 5px 15px; background: #2C5463; margin-left: 1px; white-space: nowrap; } ul li a:hover { background: #617F8A; } li:hover ul { display: block; position: absolute; } li:hover li { float: none; font-size: 11px; } li:hover a { background: #617F8A; } li:hover li a:hover { background: #95A9B1; } Breadcrumb trails
Adding a site search
Adding a sitemap
Simple Case: http://www.ineasysteps.com/site/
Complex Case: http://www.apple.com/sitemap/
Thanks for ReadingIf you would rather like to have this lecture note in printed format, please click the print action link in the top right corner. If you find any problem in this lecture note, please feel free to tell Steven via steven [at] findaway.hk. |