首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

.net中让网页正当中

2012-07-23 
.net中让网页居中悲剧发生了开始在页面中用margin:0 auto设置页面居中 但是后面在IE8和FF中都不能够居中

.net中让网页居中
悲剧发生了 开始在页面中用margin:0 auto;设置页面居中 但是后面在IE8和FF中都不能够居中了,百度了一下找到一段这样的代码 据说能行 text-align:center; 但是效果令人差强人意,求一能让页面在所有浏览器中居中(兼容性。。。)经过测试的代码 谢谢。。。。

[解决办法]
<body>
<div style="text-align:center;">
<div style="margin:0 auto;">
网站内容
</div>
</div>
</body>
[解决办法]
没有完美的解决方案吧,只能具体情况具体处理之
[解决办法]
<center></center>
[解决办法]
目前我用的是这个,还可以,在多个浏览器都没问题:
<body>
<center>
这里是网页内容
</center>
</body>
[解决办法]
固定宽度且居中.

[解决办法]
不会布局 学习一下
[解决办法]
#mainPage
{
margin:0px auto;
width:954px;
height: 911px;
max-height:1000px;
}
[解决办法]

探讨
#mainPage
{
margin:0px auto;
width:954px;height: 911px;
max-height:1000px;
}

[解决办法]
探讨
#mainPage
{
margin:0px auto;
width:954px;
height: 911px;
max-height:1000px;
}

[解决办法]
body设置居中,然后内容放在一个DIV中,DIV固定宽度
C# code
  <body style="text-algin:center"><div style="width:980px; height:100%"></div></body>
[解决办法]
<SCRIPT>
window.onload=function(){
w=400,h=400
window.resizeTo(w,h)
window.moveTo((screen.width-w)/2,(screen.height -h)/2)
}
</SCRIPT>

这种功能只能在IE中使用,其他浏览器限制使用这些方法的

热点排行