我对CSS非常陌生,在这里坐了几个小时,试图弄清楚为什么我的中间部分不显示为列。我在网上搜索显然没有成功。我尝试重新定位divs,清除所有内容并将bejesus从一切中解放出来。这一定很简单,但我不知道是什么。谁能帮忙?CSS中心列 - 清除错误?
对于大量的代码我很抱歉,如果这不合适,但我还没有上传任何东西。提前
感谢
HTML
<head><style type="text/css" media="all">@import "css/master.css";</style></head>
<body>
<div id="page-container">
<!-- RIGHT HAND PAGE -->
<div id="navbar">NavBar</div>
<div id="mediaplayer">Meda Player</div>
<div id="sightings">Sightings</div>
<div id="blogheader">Blog Header</div>
<div id="sociallinks">Social Links</div>
<!-- LEFT HAND PAGE -->
<div id="logo">Logo</div>
<div id="mainpic">MainPic</div>
<!-- CENTRE PAGE -->
<div id="headline">Headline</div>
<div id="newsitems">News Items</div>
<!-- FOOTER -->
<div id="footer">Footer</div>
</div>
</body>
</html>
CSS
#page-container {
width:960px;
margin:auto;
background:red;
}
html, body {
margin:0;
padding:0;
}
#logo {
background:purple;
height:150px;
width:270px;
margin-right:450px;
}
#mainpic {
background:darkgrey;
width:270px;
height:450px;
}
#navbar {
float:right;
background:lightblue;
height:50px;
width:690px;
}
#headline {
background:grey;
height:200px;
margin-left:270px;
margin-right:350px;
}
/* News Items Mock - height:350px */
#newsitems {
background:blue;
margin-left:270px;
margin-right:350px;
}
#mediaplayer {
clear:both;
float:right;
background:black;
height:200px;
width:350px;
}
/* Sightings Mock - height:150px; */
#sightings {
clear:both;
float:right;
background:green;
width:350px;
}
#blogheader {
clear:both;
float:right;
background:darkgreen;
height:40px;
width:350px;
}
#sociallinks {
clear:both;
float:right;
background:orange;
height:40px;
width:350px;
}
#footer {
background:yellow;
clear:both;
height:30px;
}
我无法弥补你所要设计的设计,你能发布一个模型或更好地解释你期望的是什么吗? – 2012-03-24 11:11:09
对不起 - 我编辑我的帖子以显示图像的链接,因为我的代表意味着我无法发布它。 – tomdot 2012-03-24 11:28:57
请对你的结果做一个模型你究竟需要什么,因为我们会看到它你在看什么以及你是如何制作你的模型的代码的,这样我们就可以更容易地找到你的代码中的错误并尝试得到解决方案.... – 2012-03-24 11:31:03