我不久前购买了一个剧本,它有点旧了。无论如何,页面左对齐。我对编程知之甚少。我搜索了谷歌,YouTube和Stack Overflow来找到我简单问题的答案,但没有运气。我很确定它需要以(div)标签为中心,但细节......我迷路了。请看看帮助。
a, a:visited, a:active {
color: #9b7e5b;
}
a.toplink, a.toplink:hover, a.toplink:visited, a.toplink:active {
color: #FFFFFF;
font-size: 12px;
}
.forCopyright {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
COLOR: #FFFFFF;
text-align: center;
background-color: #B57C37;
}
a.forCopyright {
text-decoration: underline;
}
body, td, .forTexts {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #000000;
}
a.menutxt, a.menutxt:hover, a.menutxt:visited, a.menutxt:active {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
color: #9b7e5b;
}
.menutxt {
PADDING-RIGHT: 2px;
PADDING-LEFT: 5px;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
color: #9b7e5b;
}
.infotxt {
PADDING-RIGHT: 5px;
PADDING-LEFT: 5px;
font-size: 10px;
}
th {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
color: #000000;
}
.title {
font-family: Verdana, Arial, Helvetica, sans-serif;
background-image: url("images/bg.jpg");
font-size: 12px;
background-color: #FFFFFF;
padding-bottom: 4px;
background-repeat: repeat-x;
}
.inpts {
BORDER-RIGHT: #9b7e5b 1px solid;
BORDER-TOP: #9b7e5b 1px solid;
FONT-SIZE: 10px;
BORDER-LEFT: #9b7e5b 1px solid;
COLOR: #000000;
BORDER-BOTTOM: #9b7e5b 1px solid;
FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;
BACKGROUND-COLOR: #ffffff
}
.sbmt {
BORDER-RIGHT: #9b7e5b 1px solid;
BORDER-TOP: #9b7e5b 1px solid;
FONT-SIZE: 10px;
BORDER-LEFT: #9b7e5b 1px solid;
COLOR: #000000;
BORDER-BOTTOM: #9b7e5b 1px solid;
FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;
BACKGROUND-COLOR: #DEC8AD;
}
a.hlp, a.hlp:active, a.hlp:visited, a.hlp:hover {
font-family: verdana;
font-size: 12px;
color: black;
text-decoration: none;
cursor: help;
}
.line {
background-color: #B57C37;
}
.bgcolorleft {
background-color: white;
}
.bgcolormain {
background-color: white;
}
.bgcolorright {
background-color: white;
}
div.framebody {
text-align: center;
}
div.main {
text-align: center;
margin: 0 auto;
}
td.inheader {
background-image: url("images/bg.jpg");
background-color: white;
font-weight: bold;
text-align: center;
padding-left: 2px;
padding-right: 2px;
padding-top: 2px;
padding-bottom: 4px;
background-repeat: repeat-x;
}
td.item {
background-color: E2B176;
text-align: center;
}
h3 {
COLOR: #664422;
FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;
text-align: center;
}
.calendartable {
background-color: #664422;
text-align: center;
}
.calendartablebg {
background-color: white;
}
.calendarweek {
background-color: #664422;
color: #FFFFFF;
text-align: center;
}
td.gray {
color: gray;
}
答案 0 :(得分:1)
您可以尝试创建一个容器div来包裹整个身体。像这样:
<body>
<div class="container">
...
...Your Website Code...
...
</div> <!-- end container -->
</body>
然后在你的css中:
.container {
width: 950px;
margin: 0 auto;
}
答案 1 :(得分:0)
没有HTML很难确定,但我猜你在div.main上需要一个宽度:
div.main {
text-align: center;
margin: 0 auto;
width: 960px;
}
答案 2 :(得分:0)
我相信“主要”div是你想要的中心。你需要在那里定义宽度。
div.main {
text-align: center;
margin: 0 auto;
width:90%;
}
或
div.main {
text-align: center;
margin: 0 auto;
width:1000px;
}
答案 3 :(得分:0)