Created
June 24, 2017 05:58
-
-
Save movii/78c04750acf46c11b9b3f4914dc1c1c0 to your computer and use it in GitHub Desktop.
笔记:前端开发中的「居中」,绝对定位,transform 和 flex 布局:4. 相对绝对定位
This file contains hidden or 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 by traditional relative/absolute position */ | |
/* parent */ | |
.box.box_centerByAbsolute { | |
position: relative; | |
} | |
/* child */ | |
.box.box_centerByAbsolute .content { | |
position: absolute; | |
top: 0; | |
right: 0; | |
bottom: 0; | |
left: 0; | |
margin: auto; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment