by Andy » Tue Oct 27, 2009 9:37 pm
First of all, you should keep your coding design-agnostic. That is, you should not use names such as "left" and "center". Instead use names that describe the content, such as "navigation".
Second of all, you should have a logo that works as a homepage link. Users would expect that. You could still "save space" by combining your graphics into a CSS sprite.
I coded the following template, which all my website projects are based off:
http://nova-group.se/template/I made it with accessibility, design-agnosticism and
Yahoo's Performance rules in mind.
As for your navigation menu, here's an example:
- Code: Select all
#navigation {
float: left;
}
#navigation h2 {
left: -999em;
position: absolute;
}
#navigation ul {
list-style: none;
margin: 0;
padding: 0;
width: 367px;
}
#navigation a {
background: url(sprite.png) no-repeat;
display: block;
height: 100px;
overflow: hidden;
text-indent: -999em;
}
#projects a { background-position: -367px 0 }
#about a { background-position: -734px 0 }
#home a:hover { background-position: 0 -100px }
#projects a:hover { background-position: -367px -100px }
#about a:hover { background-position: -734px -100px }
#content {
overflow: hidden; /* so the float won't affect my content */
}