Site-Navigation mit Listen, Beispiel 26a
Das Style-Sheet sieht so aus:
body { font-size: 15px; color: #000; background: #600 url(//graphics/herbstlaub.jpg) left top repeat-y; padding: 0; margin: 0; } #maincontent { background-color: #f4f8e8; padding: 1em; border-left: 1px solid #df6; margin: 0 0 0 174px; } #navigation { background-color: transparent; position: fixed; top: 7px; left: 7px; opacity:0.85; -moz-opacity:0.85; } #navigation LI { background-color: transparent; padding: 0; margin: 0; list-style: none; width: 160px; } #navigation UL { background-color: transparent; padding: 0; margin: 0; } #navigation A { font: bold 1em/25px sans-serif; text-decoration: none; display: block; padding: 5px 10px; border: none; margin: 0; width: 140px; display: block; } #navigation A:link, #navigation A:visited { color: #fff; background: #600 url(//graphics/navback5.gif) bottom left no-repeat; } #navigation A:hover, #navigation A:focus { color: #fff; background: #600 url(//graphics/navback3.gif) bottom left no-repeat; }
Das HTML der Seite sieht so aus:
<html> <head></head> <body> <div id="navigation"> <ul> <li><a title="Grundlagen" href="#">Grundlagen</a></li> <li><a title="Referenz" href="#">Referenz</a></li> <li><a title="Tutorials" href="#">Tutorials</a></li> <li><a title="Browsers" href="#">Browsers</a></li> </ul> </div> <div id="maincontent"></div> </body> </html>