<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>無標題文檔</title> <style type="text/css"> #t1{ background-color:#f8f8f8; border-bottom:1px solid #e6e6e6; height:24px; } #t1 p{ width:900px; margin:0px auto; padding-top:5px; float:right; font-size:12px; } #t1 p a{text-decoration:none;color:#738197;} </style> </head> <body> <div id="t1"><p style="color:#0CC"> <a href="http://pc.qq.com/">蘋果</a> · <a href="http://www.qq.com/">鴨梨</a> · <a href="http://im.qq.com/">雞蛋</a> · <a href="http://im.qq.com/mobileqq/">白菜 </a> </p> </div> </body> </html>
居中的寬度是900px
#t1 p{ width:900px; margin:0px auto; padding-top:5px; font-size:12px; overflow:hidden; text-align:right; }
去掉p標簽的右浮動,改為文本對齊方式為右對齊就可以了。
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>無標題文檔</title> <style type="text/css"> #t1{ background-color:#f8f8f8; border-bottom:1px solid #e6e6e6; height:24px; } #t1 p{ width:900px; margin:0px auto; padding-top:5px; float:right; font-size:12px; } #t1 p a{text-decoration:none;color:#738197;} </style> <div id="t1"> <p style="color: rgb(0, 204, 204); text-align: right;"> <a href="http://pc.qq.com/">蘋果</a> · <a href="http://www.qq.com/">鴨梨</a> · <a href="http://im.qq.com/">雞蛋</a> · <a href="http://im.qq.com/mobileqq/">白菜 </a> </p> </div>
聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com