為什么我的右浮動都不行,用絕對定位就可以了,是瀏覽器原因嗎?求解答!
@charset "utf-8";
/* CSS Document */
*{margin:0;padding:0;font-size:12px;}/*內(nèi)容初始化*/
body{background-color:#F5F5F5;}/*頁面背景色*/
.top{width:100%;height:27px;background:url(image/top_bg.jpg) repeat-x;}/*頂部背景圖片*/
.top_content{width:1000px;margin:0 auto;}/*頂部內(nèi)容定寬設(shè)置自動居中*/
.top_content li{list-style-image:url(image/li_bg.gif);float:right;width:70px;line-height:27px;}/*列表項設(shè)置背景圖浮動寬度和垂直居中*/
.top_content a:link,.top_content a:visited{color:#8E8E8E;text-decoration:none;}/*a的偽類(未訪問和訪問后的顏色)以及文本修飾*/
.top_content a:hover,.top_content a:active{color:#C30;text-decoration:none;}/*a的偽類(劃過和按下的顏色)以及文本修飾*/
.wrap{width:1000px;margin:0 auto;}/*wrap定寬自動居中*/
.logo{height:80px;background-color:#FFF;position:relative;}/*log高度和相對定位*/
.logo_left{width:200px;float:left;}/*定寬左浮動*/
.logo_right{width:300px;position:absolute;top:20px;right:0;color:#8E8E8E;}/*定寬絕對定位*/
.logo_right img{vertical-align:middle;margin-right:10px;}/*圖片居中和右外邊距*/
.tel{font-family:"微軟雅黑";font-size:16px;color:#C00;}/*數(shù)字字體,顏色以及大小*/
.nav{height:40px;position:relative;}/*nav高度和相對定位*/
.nav_left{width:10px;background:url(image/nav_left.jpg) no-repeat;float:left;height:40px;}/*添加左側(cè)圓角圖片左浮動*/
.nav_mid{width:990px;background:url(image/nav_bg.jpg) repeat-x;}/*添加菜單背景圖片X軸重復(fù)*/
.nav_right{width:10px;background:url(image/nav_right.jpg) no-repeat;position:absolute;top:0;left:990px;height:40px;}/*添加右側(cè)圓角圖片和絕對定位*/
2015-11-28
是不是 父級元素的寬度不夠