Skip to content

Instantly share code, notes, and snippets.

@igorpronin
Created August 15, 2015 16:03
Show Gist options
  • Save igorpronin/e68f280158ba6c7f69d5 to your computer and use it in GitHub Desktop.
Save igorpronin/e68f280158ba6c7f69d5 to your computer and use it in GitHub Desktop.
HTML, CSS / Выравнивание нижнего края элемента по центру окна браузера
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