A Pen by Wen Yongyang on CodePen.
Created
January 12, 2019 09:14
-
-
Save monsoir/d62d4e3322f3bc00810c04e4d9d45e58 to your computer and use it in GitHub Desktop.
holy-grail-layout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<header>header</header> | |
<div class="container"> | |
<div class="center">center</div> | |
<div class="left">left</div> | |
<div class="right">right</div> | |
</div> | |
<footer>footer</footer> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
header { | |
text-align: center; | |
background-color: red; | |
height: 5rem; | |
line-height: 5rem; | |
} | |
footer { | |
text-align: center; | |
background-color: yellow; | |
height: 5rem; | |
line-height: 5rem; | |
} | |
div { | |
text-align: center; | |
} | |
.container { | |
padding: 0 100px; | |
height: 10rem; | |
line-height: 10rem; | |
} | |
.container::after { | |
content: ''; | |
clear: both; | |
visibility: hidden; | |
display: block; | |
font-size: 0; | |
height: 0; | |
} | |
.center { | |
width: 100%; | |
float: left; | |
background-color: orange; | |
border-width: 10px; | |
border-color: black; | |
} | |
.left { | |
float: left; | |
margin-left: -100%; | |
position: relative; | |
right: 100px; | |
width: 100px; | |
background-color: silver; | |
} | |
.right { | |
float: left; | |
margin-right: -100px; | |
width: 100px; | |
background-color: pink; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment