li標籤中,前部分標籤左對齊,後部分標籤右對齊
阿新 • • 發佈:2019-01-24
用了網上的方法都沒有實現,下面用了span在標籤
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=GBK" /> <title>橫向導航欄</title> <link rel="stylesheet" href="css.css" type="text/css" /> <style> @charset "GBK"; /* CSS Document */ <!----> #top{ width:980px; height:119px; margin:0px auto; background-image:url(images/book_02.gif);} .nav ul{width:980px; margin:0px auto; height:38px; padding:0; background-image:url(images/book_04.gif);} .nav ul li {float:left; list-style-type:none;} .nav ul span {float:right; } .nav ul li a{;margin:5px 40px;font-size:12px;display:block;text-align:center;text-decoration:none;} .nav ul li a:hover{background:#FFF;} </style> </head> <body> <div id="top"></div> <div class="nav"> <ul> <li><a href="#">首頁</a></li> <li><a href="#">新增</a></li> <li><a href="#">管理</a></li> <span> <li><a href="#">導航4</a></li> <li><a href="#">導航5</a></li> <li><a href="#">導航6</a></li> </span> </ul> </div> </body> </html>