本文共 1970 字,大约阅读时间需要 6 分钟。
Title 说明:练习一下导航怎么写,同时试着用less来写样式。 需要更多信息请查看: http://blog.csdn.net/dongxingpeng
@red :#000;@white :#CA952D;@li-width : 200px;@fontSize: 20px;html,body{ background: @red; margin: 0; padding: 0;}header{ width: 100%; height: 30px; color: @white; .nav{ width: 1200px; margin: 0 auto; height: 30px; text-align: center; font-size: 16px; } .nav li{ float: left; width: @li-width; list-style-type: none; line-height: 30px; } .nav li a,.nav-list li a{ text-decoration: none; color: @white; } .nav-list { position: relative; display: none; left: -40px; z-index: 99; width: 100px; background: #00ff00; } .show-list{ display: block; }}.instruction{ position: fixed; top:50%; left:30%; clear: both; color: @white; font-size: @fontSize; a{ color: @white; text-decoration: none; }}