Created
April 20, 2014 05:01
-
-
Save davidberard98/11105516 to your computer and use it in GitHub Desktop.
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> | |
<style type="text/css"> | |
body, html | |
{ | |
padding:0; | |
margin:0; | |
width:100%; | |
height:100%; | |
} | |
div.fix | |
{ | |
position:fixed; | |
padding:0; | |
margin:0; | |
width:100%; | |
height:100%; | |
top:0; right:0; | |
background-color:#DDFFFF; | |
z-index:-1; | |
} | |
div.margauto | |
{ | |
display:block; | |
width:400px; | |
margin-left: auto; | |
margin-right: auto; | |
margin-top: 100px; | |
height:300px; | |
background-color:#FFFFDD; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="fix"> | |
<div class="margauto">Positioned center, 100px from top the fixed div</div> | |
</div> | |
a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br />a<br /> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment