<head>
<title>Испытание: строим сетку</title>
<meta charset="utf-8">
</head>
<body>
<div class="header">
<div class="layout-positioner">
<div class="layout-column">
Header
</div>
</div>
</div>
<div class="menu">
<div class="layout-positioner">
<div class="layout-column">
Menu
</div>
</div>
</div>
<div class="promo">
<div class="layout-positioner">
<div class="layout-column column-1">
Promo 1
</div>
<div class="layout-column column-2">
Promo 2
</div>
</div>
</div>
<div class="main">
<div class="layout-positioner">
<div class="layout-column column-1">
Left
</div>
<div class="layout-column column-2">
Main
</div>
<div class="layout-column column-3">
Right
</div>
</div>
</div>
<div class="footer">
<div class="layout-positioner">
<div class="layout-column">
Footer
</div>
</div>
</div>
</body>
CSS
html,
body {
margin: 0;
padding: 0;
}
body {
width: 450px;
height: 335px;
font-family: “Arial”, sans-serif;
font-size: 10px;
color: white;
}
.header, .promo {
background-color: #34495e;
padding: 10px 0;
}
.layout-positioner {
margin: 0 auto;
width: 350px;
}
.layout-positioner::after {
content: “”;
display: table;
clear: both;
}
.layout-column {
padding: 5px;
}
.header .layout-column {
background-color: #c0392b;
min-height: 25px;
}
.menu {
background-color: #3498DB;
}
.menu .layout-column {
min-height: 25px;
}
.promo .layout-column {
float: left;
width: 160px;
height: 50px;
margin-right: 10px;
background-color: #c0392b;
}
.promo .layout-column:last-child {
margin-right: 0;
}
.main {
padding: 10px 0;
}
.main .layout-column {
float: left;
height: 100px;
margin-right: 10px;
background-color: #3498DB;
}
.main .layout-column:last-child {
margin-right:0;
}
.main .column-1, .main .column-3 {
width: 60px;
}
.main .column-2 {
width: 180px;
}
.footer {
background-color: #34495e;
height: 50px;
}
/*
Используемые цвета:
#34495e – мокрый асфальт
#c0392b – красный
#3498DB – синий
*/