Created
June 9, 2018 04:13
-
-
Save zenHeart/27e6a6bb8121e1951024e9489515d863 to your computer and use it in GitHub Desktop.
flex 垂直水平居中
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Title</title> | |
<style type="text/css"> | |
html, body { | |
height: 100%; | |
} | |
body { | |
margin: 0; | |
} | |
.flex-center-container { | |
height: 100%; | |
padding: 0; | |
margin: 0; | |
display: -webkit-box; | |
display: -moz-box; | |
display: -ms-flexbox; | |
display: -webkit-flex; | |
display: flex; | |
align-items: center; | |
justify-content: center; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="flex-center-container"> | |
<p contenteditable="true">test</p> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment