I have been working on website templates for quite some time now and I guess a technique that I commonly use is worth sharing.
If you would like to use images for your menus, here's a good technique I found from CSS Play (although I can't find the specific link that directs to the technique). I have tested it on Firefox and IE6+ and seems to work perfectly. Anyways, here's how I use it. In my templates I use this html code:
GeSHi © 2004-2007 Nigel McNie, 2007-2008 Benny Baumann, 2008 Milian Wolff
And this is the CSS code:
GeSHi © 2004-2007 Nigel McNie, 2007-2008 Benny Baumann, 2008 Milian Wolff
- #menu { width: 800px; margin: auto; }
- #menu ul {
- list-style: none;
- padding: 0;
- margin: 0;
- }
- #menu li {
- display: block;
- float: left;
- }
- #menu a {
- display: block;
- height: 0;
- width: 160px;
- padding-top: 40px;
- overflow: hidden;
- }
- .link1 { background: url('images/home.gif') no-repeat; }
- .link2 { background: url('images/about.gif') no-repeat; }
- .link3 { background: url('images/services.gif') no-repeat; }
- .link4 { background: url('images/projects.gif') no-repeat; }
- .link5 { background: url('images/contact.gif') no-repeat; }
Quite long eh? Anyways, it's pretty self-explanatory I guess. If not, I think trying it and experimenting with each line would be best to know how it works.
0 comments:
Post a Comment