Css Layouts 101 - Getting Confused In Structuring Layout
For this layout, the easiest structuring method I can find with pure css is by using the vh unit. Since its a bit restrictive in its support and the requirement being to go with on
Solution 1:
Check if this is what you are looking for:
* {
box-sizing: border-box;
}
html,
body {
margin: 0;
padding: 0;
font-size: 22px;
text-transform: uppercase;
}
body {
padding-top: 100vh;
}
.cover {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
background: #eee;
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
}
footer {
background: #222;
color: #fff;
display: flex;
height: 60px;
align-items: center;
justify-content: center;
z-index: 999;
}
section {
padding: 10px;
margin: 25px;
border: 1px solid #000;
}
<divclass="cover">cover</div><section>
section 1
<br/>section 1
<br/>section 1
<br/>section 1
<br/>section 1
<br/>section 1
<br/>section 1
<br/></section><section>
section 2
<br/>section 2
<br/>section 2
<br/>section 2
<br/>section 2
<br/>section 2
<br/>section 2
<br/>section 2
<br/>section 2
<br/>section 2
<br/>section 2
<br/></section><section>
section 3
<br/>section 3
<br/>section 3
<br/>section 3
<br/>section 3
<br/>section 3
<br/>section 3
<br/>section 3
<br/>section 3
<br/>section 3
<br/>section 3
<br/>section 3
<br/>section 3
<br/></section><footer>footer</footer>
Post a Comment for "Css Layouts 101 - Getting Confused In Structuring Layout"