最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

IE下面网页居中显示的问题_html/css

来源:懂视网 责编:小采 时间:2020-11-27 16:31:55
文档

IE下面网页居中显示的问题_html/css

IE下面网页居中显示的问题_html/css_WEB-ITnose:ie 居中 页面在Chrome和FF下是居中的,但在IE各个版本下面都是靠左显示的, .center{margin:0px auto;} 这两个都加上了,请问各位大侠还有什么需要注意的地方? 回复讨论(解决方案) body, html{width:100%;height:100%;
推荐度:
导读IE下面网页居中显示的问题_html/css_WEB-ITnose:ie 居中 页面在Chrome和FF下是居中的,但在IE各个版本下面都是靠左显示的, .center{margin:0px auto;} 这两个都加上了,请问各位大侠还有什么需要注意的地方? 回复讨论(解决方案) body, html{width:100%;height:100%;

ie 居中

页面在Chrome和FF下是居中的,但在IE各个版本下面都是靠左显示的,

.center{margin:0px auto;}

这两个都加上了,请问各位大侠还有什么需要注意的地方?


回复讨论(解决方案)

body, html{width:100%;height:100%;}
.center{margin:0px auto;}

body, html{width:100%;height:100%;}
.center{margin:0px auto;}
加上了第一句了,还是不行啊!

相关CSS文件如下:

/*---------- base ---------*/
*{padding:0px;margin:0px;}
html{background:#FFF;}
body{font:12px Verdana,Arial,Tahoma; line-height: 1.8em; color:#999999;}
img{border:none;}

button {
border: 1px solid #CCCCCC;
padding: 5px;
cursor:pointer;
}
a{color:#666666;text-decoration:none;}
a:hover{ background-color:#8D900B; color:#ffffff}
.header a:hover,.pagelist a:hover,.favorite a:hover,.pic a:hover,a.pic:hover{ color:#8D900B; background-color:#ffffff}
ul,li{list-style:none;}
input,select,button{font:12px Verdana,Arial,Tahoma;vertical-align:middle;}
h1, h2, h3, h4, h5, h6 {font-family: "Microsoft YaHei";font-size: 100%;font-weight: normal;}
/*---------- stock ---------*/
.center{margin:0px auto;}
.w960{width:960px;}
.wrapbox {margin: 0 auto;width: 960px;clear:both;}
.mainbox{ width:630px; float:left; overflow:hidden}
.sidebox{ width:300px; float:right; overflow:hidden}
.fl{ float:left}
.fr{ float:right}
.mt1{margin-top:8px;}
.mt2{margin-top:16px;}
.clear{overflow:hidden; clear:both; height:1px; line-height:1px;}
.fs-12{font-size:12px;}
.fc-f60{color:#F60;}
.fc-f90{color:#F90;}
.clr{clear:both;}
.ipt-txt{line-height:15px;padding:4px 5px;border-width:1px;border-style:solid;border-color:#ccc;font-size:12px;margin-right:2px;}
.nb{line-height:20x;padding:1px 2px;border-width:1px;border-style:solid;border-color:#666 #BBB #BBB #666;font-size:12px;margin-right:2px}
.btn-1{padding: 0px;width:56px;height:24px;border:none;background:url(../images/comm-bt.gif) no-repeat;line-height:25px;letter-spacing:1px;cursor:pointer;overflow:hidden;color:#585858;}
.btn-2{width:70px;height:25px;border:none;background:url(../images/btn-bg2.gif) left top no-repeat;line-height:25px;overflow:hidden;color:#444;margin-right:2px;cursor:pointer;}
.header{width:100%;overflow:hidden; margin-bottom: 10px;}
.header_top{background: url("../images/topbar.png") repeat-x scroll 0 -8px transparent;clear: both;height: 28px;line-height:26px;}
.header_top .welcome{float:left;padding-left:10px;height:26px;line-height:26px; }
.header_top a.rss{}
.header_top .toplinks{ float:right;height:26px;line-height:26px;}
.header_top .toplinks a{margin:0 2px;}
.header_top .toplinks span{margin-left:15px;}
.header .top{ /**background:url("../images/line.gif") repeat-x scroll left bottom transparent;**/ border-bottom:1px solid #FAEFE3; height:96px;position: relative;overflow: hidden;}
.logo {height: 85px;width:345px;position:absolute;left:0;top:0}
.logo h1 a {background: url("../images/logo.gif") no-repeat scroll 0 0 transparent;display: block;height: 85px;overflow: hidden;text-indent: -9999em;width: 345px;}
.hi{ float:left}
.userface{ float:right; margin-top:5px;}
.userface img{ border:1px solid #dddddd; padding:1px;}
.userface a:hover{ background:none;}
.userface a:hover img{ border:1px solid #8D900B}
.mylink{ float:left}
.mylink li{ float:left}

把你的HTML的完整代码贴上来呀

要不然你试试这个:
body{ text-align:center; }
.center{ margin:0 auto; text-align:left; }

要不然你试试这个:
body{ text-align:center; }
.center{ margin:0 auto; text-align:left; }
这个倒是居中了,但所有文本也居中了

再为不需要居中的设置text-align:left;不就行了?

很多标签啊,都要设岂不是太麻烦了?

很多标签啊,都要设岂不是太麻烦了?
你把完整的HTML代码贴出来呀,你之前贴的不完整

引用 8 楼 crazyzyc 的回复:很多标签啊,都要设岂不是太麻烦了?
你把完整的HTML代码贴出来呀,你之前贴的不完整

这个是Header.html的代码

<?=$headtitle?>/css/index.css" rel="stylesheet" type="text/css" />
文档

IE下面网页居中显示的问题_html/css

IE下面网页居中显示的问题_html/css_WEB-ITnose:ie 居中 页面在Chrome和FF下是居中的,但在IE各个版本下面都是靠左显示的, .center{margin:0px auto;} 这两个都加上了,请问各位大侠还有什么需要注意的地方? 回复讨论(解决方案) body, html{width:100%;height:100%;
推荐度:
标签: 显示 居中 IE
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top