-
-
Save xxjinwei/f878ab06265e6a086f08 to your computer and use it in GitHub Desktop.
fixed center and middle // source http://jsbin.com/lepane
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> | |
<head> | |
<meta charset="utf-8"> | |
<title>fixed center and middle</title> | |
<style id="jsbin-css"> | |
div { | |
position: fixed; | |
width: 200px; | |
height: 200px; | |
background-color: orange; | |
left: 0; | |
right: 0; | |
top: 0; | |
bottom: 0; | |
margin: auto; | |
} | |
</style> | |
</head> | |
<body> | |
<div> | |
</div> | |
<script id="jsbin-source-css" type="text/css">div { | |
position: fixed; | |
width: 200px; | |
height: 200px; | |
background-color: orange; | |
left: 0; | |
right: 0; | |
top: 0; | |
bottom: 0; | |
margin: auto; | |
}</script> | |
</body> | |
</html> |
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
div { | |
position: fixed; | |
width: 200px; | |
height: 200px; | |
background-color: orange; | |
left: 0; | |
right: 0; | |
top: 0; | |
bottom: 0; | |
margin: auto; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment