网页如何居中显示(css),请高手帮忙修改代码

来源:百度知道 编辑:UC知道 时间:2024/05/13 16:54:11
用Photoshop做好模板后,提高屏幕分辨率后,网页始终不能居中显示(偏向了屏幕左边),代码如下,恳请请高手指教。index.htm和css 部分的代码如下
css 部分的代码:
<style type="text/css">
<!--

body{
margin:0px auto;
FONT-SIZE:14px;
LINE-HEIGHT:150%;
TEXT-ALIGN: center;
vertical-align:middle;
BACKGROUND: #EBE6DC;
font-family:arial,'新宋体',sans-serif,'宋体';
}

#__01 {
position:relative;
left:0px;
top:0px;
width:1000px;
height:1100px;
}

#index-01_ {
position:absolute;
left:0px;
top:0px;
width:213px;
height:96px;
}

#index-02_ {
position:absolute;
left:213px;
top:0px;
width:468px;
height:32px;
}

#index-03_ {

position:absolute;
left:681px;
top:0px;
width:62px;
height:32px;
}

#index-04_ {

position:absolute;
left:743px;
top:0px;
width:91px;

margin:0px auto; 这个要设了宽度width才能起效果的 你试试把宽度定义了,要是不行再提出来

<center>其它代码</center>

是用dreamwaver8做的化就 选中表格在下面的属性里 有个水平属性,把它的值改为居中.