Created
October 7, 2014 15:00
-
-
Save feo52/27ddc3f6a033b1b070f0 to your computer and use it in GitHub Desktop.
position:sticky
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<style type="text/css"> | |
.containerL{ background:LightGrey; display:inline-block; width:45%; height:800px; float:left; } | |
.containerS{ background:LightGrey; display:inline-block; width:45%; height:400px; float:right; margin:200px 0; } | |
.marginL { background:Gainsboro; display:inline-block; width:10%; height:352px; } | |
.marginS { background:Gainsboro; display:inline-block; width:10%; height:152px; } | |
.stickyT { background:LightPink; display:inline-block; width:33%; height: 32px; float:left; text-align:center; line-height:32px; } | |
.stickyB { background:LightBlue; display:inline-block; width:33%; height: 32px; float:left; text-align:center; line-height:32px; } | |
.stickyM { background:LimeGreen; display:inline-block; width:33%; height: 32px; float:left; text-align:center; line-height:32px; } | |
.stickyT{ | |
position: -webkit-sticky; | |
position: sticky; | |
top: 0px; | |
} | |
.stickyB{ | |
position: -webkit-sticky; | |
position: sticky; | |
bottom: 0px; | |
} | |
.stickyM{ | |
position: -webkit-sticky; | |
position: sticky; | |
top: 0px; | |
bottom: 0px; | |
} | |
</style> | |
</head> | |
<body> | |
change window-size.<br /> | |
change scrollbar-position.<br /> | |
<br /> | |
<div class="containerL"> | |
<div class="marginL"> </div><br /> | |
<div class="stickyT">stickyT</div><br /> | |
<div class="stickyM">stickyM</div><br /> | |
<div class="stickyB">stickyB</div><br /> | |
</div> | |
<div class="containerS"> | |
<div class="marginS"> </div><br /> | |
<div class="stickyT">stickyT</div><br /> | |
<div class="stickyM">stickyM</div><br /> | |
<div class="stickyB">stickyB</div><br /> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment