Created
August 15, 2015 16:03
-
-
Save igorpronin/e68f280158ba6c7f69d5 to your computer and use it in GitHub Desktop.
HTML, CSS / Выравнивание нижнего края элемента по центру окна браузера
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
HTML | |
<div class="wrap"> | |
<div class="content"> </div> | |
</div> | |
CSS | |
.wrap { | |
background-color: green; | |
position: absolute; | |
top: 0; | |
bottom: 0; | |
left: 0; | |
right: 0; | |
/* Растягиваем элемент на весь экран. */ | |
vertical-align: middle; | |
text-align: center; | |
} | |
.wrap:before { | |
content: ""; | |
display: inline-block; | |
height: 100%; | |
width: 0px; | |
vertical-align: middle; | |
} | |
.content { | |
width: 200px; | |
height: 150px; | |
background-color: red; | |
display: inline-block; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment