把寬度擴(kuò)大了一些,怎么讓ul被填滿(mǎn)
.main?{ ????width:?598px; ????height:?298px; ????border:?1px?solid?#eee; ????overflow:?hidden; ????margin:?10px?auto; } .main-til?{ ????height:?47px; ????position:?relative; } .main-til?ul?{ ????position:?absolute; ????width:?601px; ????left:?-1px; } .main-til?li?{ ????float:?left; ????width:?117px; ????height:?46px; ????line-height:?46px; ????text-align:?center; ????overflow:?hidden; ????background:?#F7f7F7; ????border-bottom:?1px?solid?#eee; ????padding:0?1px; } .main-til?li?a:link,?a:visited?{ ????color:?#000; ????text-decoration:?none; } .main-til?li?a:hover?{ ????color:?#F90; } .select?{ ????background:?#FFFFFF; ????border-bottom-color:?#FFFFFF; ????border-left:?1px?solid?#eeeeee; ????border-right:?1px?solid?#eeeeee; ????padding:0; ????font-weight:?bold; }
把li的寬度設(shè)為118px就會(huì)產(chǎn)生溢出,誰(shuí)能告訴我怎么設(shè)置padding值
2017-01-08
這個(gè)要精確計(jì)算,不能精確的或者可以這樣,平分每個(gè)li的寬度取不溢出的寬度,看看與總ul的寬度還差多少,對(duì)其中一個(gè)li獨(dú)立設(shè)置一個(gè)class控制其寬度,1~2個(gè)像數(shù)很難肉眼看出來(lái) 。。
2017-01-08
或者又可以對(duì) li 設(shè)置margin:0 auto;