Last active
March 15, 2017 18:41
-
-
Save totaku/c3b715d938b90df49329 to your computer and use it in GitHub Desktop.
Center 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
.center { | |
top: 50%; /* Отступ в процентах от верхнего края окна */ | |
left: 50%; /* Отступ в процентах от левого края окна */ | |
width: 450px; /* Ширина блока */ | |
height: 450px; /* Высота блока */ | |
position: absolute; /* Абсолютное позиционирование блока */ | |
margin-top: -225px; /* Отрицательный отступ от верхнего края страницы, должен равняться половине высоты блока со знаком минус */ | |
margin-left: -225px; /* Отрицательный отступ от левого края страницы, должен равняться половине высоты блока со знаком минус */ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment