margin-left:auto; margin-right:autoh失效;


@charset "utf-8";

/* CSS Document */

/*公用*/

.comwidth{width:1000px; margin-left:auto; margin-right:auto;}

.leftArea{float:left;}

.rightArea{float:right;}

.hide{display:none;}

.show{display:block;}


/*topBar*/

.topBar{height:31px; background-color:#f7f7f7;line-height:31px;}

.collection{ background:url(../images/icon/collection.jpg) left center no-repeat; padding-left:19px;

font-weight:bold;}

.topBar a:hover{ color:#F00;}

/*logo*/

.logoBar{ height:85px; background-color:#1D7AD9;}

.logo{ padding-left:41px; padding-top:13px;}

/*search*/

.secarch_box{width:430px; padding-top:23px; padding-left:185px;}

.search_text{width:350px;height:35px; line-height:35px\9;/*css hack  \9 代表所有的ie浏览器*/ padding:0 5px; background-color:#FFF;}

.search_btn{width:70px; height:35px; font-size:14px; font-family:"Microsoft YaHei", "微软雅黑"; background-color:#FF8C00; color:#FFF;}

/*购物车*/

.shopCar{width:145px; height:35px;background-color:#FF8C00; margin-top:23px;font:14px/35px "Microsoft YaHei", "微软雅黑"; color:#FFF; margin-right:59px; display:inline;}

.shopText{/*font-size:14px; font-family:"Microsoft YaHei", "微软雅黑"; line-height:35px;*/  height:100%; width:87px; border-right:#E27A00 solid 1px; background:url(../images/icon/shaoIcon.jpg) 10px center no-repeat; text-indent:40px;}

.shopNum{width:27px; height:35px; border-left:#FF9C01 solid 1px; background:url(../images/icon/sj.jpg) 33px center no-repeat; text-align:right; padding-right:29px;}

/*导航栏*/

.navBox{height:35px; background-color:#1369C0;color:#fff; }

.shopClass{width:190px; position:relative; }

.shopClass h3{ text-align:center; line-height:35px;}

.shopClass i{ width:11px; height:7px; overflow:hidden; background:url(../images/icon/down.jpg) left center no-repeat; display:inline-block; margin-left:11px;}

.nav,.shopClass{font-family:"Microsoft YaHei UI", "微软雅黑";}

.nav{line-height:35px;}

.nav li{float:left;}

.nav a{ height:35px; display:inline-block; padding:0 35px; color:#fff;}

.nav .activer{ background-color:#4593FD;}

/*商品弹出列表*/

.shopClass_show{background-color:#4593Fd;position:absolute

; left:0; top:35px; width:100%;}

.shopClass_item{padding:14px 10px; border-bottom:#3487F2

 solid 1px; border-top:#5AA1FE solid 1px;}

.shopClass_item dt{height:20px; background:url(../images/icon/shop_sj.jpg) right center no-repeat;} 

.shopClass_item .big{ font:14px/1 "Microsoft YaHei UI", "微软雅黑";}

.shopClass_item a{color:#fff; text-decoration:underline;}

.shopClass_item .alink{width:48px; height:20px; background:url(../images/icon/aLink_bg.png) left center no-repeat; display:inline-block; text-align:center; line-height:20px; text-decoration:underline;}

/*banner*/

.banner{ margin-bottom:15px;}

.banner_bar{width:810px; height:325px; float:right; position:relative; overflow:hidden;}

.imgbox{ width:1620px; height:325px; position:absolute; left:0px; top:0;}

.imgbox ul{padding:0; margin:0;}

.imgbox li{float:left;}

.imgbox img{width:810px; height:326px; display:block;}

.imgnum{position:absolute; left:0; bottom:15px; width:100%; text-align:center;}

.imgnum a{width:20px;height:5px; overflow:hidden; background-color:#fff; display:inline-block; margin:0 3px;}

.imgnum .active{background-color:FF7700;}

/*商品*/

.shoptit{ height:44px; font-family:"Microsoft YaHei UI", "微软雅黑"; line-height:44px; margin-bottom:15px;}

.shoptit h3{font-size:24px; float:left; font-weight:normal; padding-left:15px;}

.icon{width:44px; height:44px; background:url(../images/icon/shopIcon.jpg) left top no-repeat; float:left;}

.more{float:right; font-family:"宋体";}

.more:hover{text-decoration:underline;}

.shoplist{ float:left; }

/*商品列表*/

.shoplist .leftArea{width:190px;}

.shoplist .rightArea{width:808px; border:#999 solid 1px; border-bottom:#FF7201 solid 3px; height:396px; overflow:hidden;}


wxx
浏览 5650回答 3
3回答

sdwsq

想居中 元素必须有宽度 而且是diaplay:block  浮动会让居中失效

eko4107343

把html贴出来啊

Tobey_滔

如果你想一个容器左右居中的话....可以使用margin:0 auto;即可
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Html5
CSS3