<style type="text/css">
/*reset*/
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td{
margin: 0;padding: 0;list-style: none;font-size: 12px;
font-family: "Arial", "sans-serif", "微軟雅黑", "宋體", "Tahoma";}
a{cursor: pointer;text-decoration: none}
/*reset*/
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td{
margin: 0;padding: 0;list-style: none;font-size: 12px;
font-family: "Arial", "sans-serif", "微軟雅黑", "宋體", "Tahoma";}
a{cursor: pointer;text-decoration: none}
ul{list-style:none}
*{margin:0; padding:0;}
li h3{text-align:center; font-size:14px; font-weight:400;}
li{display:block;
height:31px;
line-height:31px;
border-bottom:1px solid #dedede ;
overflow:hidden;
}
.cat{background:#f8f8f8; width:150px;border: 1px solid #a9a9a9;margin:10px;}
*{margin:0; padding:0;}
li h3{text-align:center; font-size:14px; font-weight:400;}
li{display:block;
height:31px;
line-height:31px;
border-bottom:1px solid #dedede ;
overflow:hidden;
}
.cat{background:#f8f8f8; width:150px;border: 1px solid #a9a9a9;margin:10px;}
已采納回答 / 丶小八戒
首先你通過給<p>標簽設置樣式來達到這種按鈕效果就有所不妥。你兩個按鈕實際上<p>標簽顯示出來的結果,與button標簽無關。(你這理button標簽還拼錯了,不是botton)你可以去掉<p>標簽的樣式,然后分別定義c1,c2兩個按鈕的樣式,從而達到你想要的效果。<...code...>? ??
2015-12-11
已采納回答 / RenneXV
h3是塊元素,默認寬度100%,你父元素如果和瀏覽器一樣寬..那margin auto不就沒有了么..文字居中可以試試text-align:center; 或者設定寬度 margin:0 auto;
2015-12-10