Html 如何重新排列css中的div?

Html 如何重新排列css中的div?,html,css,web,Html,Css,Web,我想创建这样的页面:使用以下参数: Background: red header: 70px tall, black background, is always at the top of your browser (fixed position), total width Content: 500px wide, centered in height matches the contents of a blue background, the browser scrolljának

我想创建这样的页面:使用以下参数:

Background: red
header: 70px tall, black background, is always at the top of your browser       (fixed position), total width
Content: 500px wide, centered in height matches the contents of a blue background, the browser scrolljának top position 30px from the header
Left column: 300px wide (including frame), 550px high and 25px from the container to containing a yellow background, black border 5px
Right column: 125px wide, 200px high, white background, 25px on the container to contain'
我只是这样做了:

使用此代码:

*{
margin:0;
padding:0;
}


html, body
{
height: 100%;
width: 100%;
background-color: red;
}

#fejlec{
height: 70px;
width: 100%;
background-color: black;
background-position:top;
background-attachment:fixed;
position: fixed;
}

#kek{

background-color: blue;
width: 500px;
height: 100%;
position: absolute;
top:170px;
bottom: 0;
left: 0;
right: 0;
margin: auto;
}

#sarga{
background-color: yellow;
width:260px;
height: 550px;
padding:20px;
border:5px solid black;
position: absolute;
top:-25px;
bottom: 0;
left: 0;
right: 0;
margin: auto;
float: left ;


}

#feher
{
background-color: white;
width:125px;
height: 200px;
padding:25px;
}

我不知道该由谁用css来安排div,所以如果有人能帮我的话,它可能会非常有用

这应该让您开始:

html:


有很多方法可以实现这种布局

与switz的解决方案类似的另一个解决方案可能是:

HTML

<div id="fejlec"></div>
<div id="kek">
  <div id="sarga"></div>
  <div id="feher"></div>
  <div class="clear"> </div>
</div>

我们必须登录您的第二个dropbox链接。请修改。另外,HTML在哪里?您还有一个额外的结束
div
。否则,这是一个很好的解决方案。很好的呼叫-已修复。
html {
  background: red;
}

.header {
  height: 70px;
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  background: black;
}   

.container {
  width: 500px;
  margin: 100px auto;
  background: blue;
}

.content {
  width: 300px;
  height: 550px;
  margin: 25px;
  display: inline-block;
  vertical-align: top;
  background: yellow;
}

.sidebar {
  width: 125px;
  height: 200px;
  margin: 25px 0 25px 0;
  display: inline-block;
  vertical-align: top;
  background: white;
}
<div id="fejlec"></div>
<div id="kek">
  <div id="sarga"></div>
  <div id="feher"></div>
  <div class="clear"> </div>
</div>
*{
margin:0;
padding:0;
}


html, body
{
height: 100%;
width: 100%;
background-color: red;
}

.clear {
  clear: both;
}
#fejlec {
height: 70px;
width: 100%;
background-color: black;
position: fixed;
top: 0
}

#kek {
background-color: blue;
width: 500px;
margin: 100px auto 0;
padding: 20px;
}

#sarga {
background-color: yellow;
width:260px;
height: 550px;
padding:20px;
float: left;
border:5px solid black;
}

#feher {
background-color: white;
width:26%;
height: 200px;
padding:25px;
float: right;
}