0
我如何居中?我正在嘗試構建一個960像素的網頁,但是當測試時它始終保持在左側(附上截圖)。不能居中網站
我該如何解決這個問題?感謝所有能夠幫助的人!
<html>
<head>
<style>
body {
background-color:WHITE;
width: 960px centered;
}
.one {
background: #B1B4B5;
color: BLACK;
font-size: 60px;
width: 60px;
height: 60px;
overflow:hidden;
float:left;
position:absolute;
top: 0px;
left: 0px;
text-align: center;
}
.two {
background: #B1B4B5;
color: BLACK;
font-size: 60px;
width: 60px;
height: 60px;
overflow:hidden;
float:left;
position:absolute;
top: 0px;
left: 900px;
text-align: center;
}
.three{
background: #B1B4B5;
color: BLACK;
font-size: 60px;
width: 60px;
height: 60px;
overflow:hidden;
float:left;
position:absolute;
top: 500px;
left: 0px;
text-align: center;
}
.four {
background: #B1B4B5;
color: BLACK;
font-size: 60px;
width: 60px;
height: 60px;
overflow:hidden;
float:left;
position:absolute;
top: 500px;
left: 900px;
text-align: center;
}
</style>
</head>
<body>
<a class="one">1</a>
<a class="two">2</a>
<a class="three">3</a>
<a class="four">4</a>
</body>
</html>
到中心通常應用餘量餘量{:0汽車;} – Praveen
設定寬度和餘量:0汽車;將任何屏幕的容器居中 – Saran