Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
「position:fixedの起点を親要素にするCSS」のCSS
*{
padding:0;
margin:0;
}
#wrap{
width:100%;
height:100%;
}
#main{
width:70%;
height:800px;
color:#fff;
background-color:#2077b2;
}
#sidebar{
width:150px;
height:300px;
color:#fff;
position:fixed;
top:0;
margin-left:75%;
background-color:#b52020;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment