Skip to content

Instantly share code, notes, and snippets.

@xxjinwei
Forked from anonymous/index.html
Last active August 29, 2015 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xxjinwei/f878ab06265e6a086f08 to your computer and use it in GitHub Desktop.
Save xxjinwei/f878ab06265e6a086f08 to your computer and use it in GitHub Desktop.
fixed center and middle // source http://jsbin.com/lepane
<!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>
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