在 DreamWeaver 中,一切都编译得很好,在设计选项卡上看起来很正常,但是当我切换到 localhost 时,我满足的 DIV 只在左侧显示文本,而它们应该在中间。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="/css/style.css" type="text/css">
<title>Title</title>
</head>
<body>
<img src="images/barColor.jpg" width="1" height="71" alt="barColor" />
<p> </p><p> </p><p> </p><p> </p><p> </p>
<div class="wrdLatest" id=1> content of id 1 <p> </p><p> </p><p> </p><p> </p> </div>
<div class="wrdLatest" id=2> content of id 2 <p> </p><p> </p><p> </p><p> </p><p> </p> </div>
<div class="wrdLatest" id=3> content of id 3 <p> </p><p> </p><p> </p><p> </p> </div>
<div class="wrdLatest" id=4> content of id 4 <p> </p><p> </p><p> </p><p> </p><p> </p> </div>
<div class="wrdLatest" id=5> content of id 5 <p> </p><p> </p><p> </p><p> </p><p> </p> </div>
<div class="wrdLatest" id=6> content of id 6 <p> </p><p> </p><p> </p><p> </p><p> </p> </div>
<div class="wrdLatest" id=7> content of id 7 <p> </p><p> </p><p> </p><p> </p><p> </p> </div>
<div class="wrdLatest" id=8> content of id 8 <p> </p><p> </p><p> </p><p> </p><p> </p> </div>
<div class="wrdLatest" id=9> content of id 9 <p> </p><p> </p><p> </p><p> </p><p> </p> </div>
<div class="wrdLatest" id=10> content of id 10 <p> </p><p> </p><p> </p><p> </p><p> </p> </div>
<div class="wrdLatest" id=11> content of id 11 <p> </p><p> </p><p> </p><p> </p><p> </p> </div>
<div class="wrdLatest" id=12> content of id 12 <p> </p><p> </p><p> </p><p> </p><p> </p> </div>
</body>
</html>
然后是 style.css
#wrdLatest {
background: url('../images/spacing.png') repeat-y;
z-index: -1;
padding: 20px;
margin-left: auto;
margin-top: auto;
width: 75%;
height: 100%;
min-height: 25px;
min-width: 25px;
background-repeat: repeat-y;
style="text-align: center;"
}
非常感谢任何帮助......是的,我是 HTML 新手。