源代码
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>编程字典</title> <style> #navlist { position: relative; } #navlist li { margin: 0; padding: 0; list-style: none; position: absolute; top: 0; } #navlist li, #navlist a { height: 44px; display: block; } #home { left: 0px; width: 46px; background: url('img_navsprites.gif') 0 0; } #prev { left: 63px; width: 43px; background: url('img_navsprites.gif') -47px 0; } #next { left: 129px; width: 43px; background: url('img_navsprites.gif') -91px 0; } </style> </head> <body> <ul id="navlist"> <li id="home"><a href="default.html"></a></li> <li id="prev"><a href="css_intro.html"></a></li> <li id="next"><a href="css_syntax.html"></a></li> </ul> </body> </html>
运行结果