Skip to content

Instantly share code, notes, and snippets.

@h4
Created February 21, 2012 16:32
Show Gist options
  • Save h4/1877270 to your computer and use it in GitHub Desktop.
Save h4/1877270 to your computer and use it in GitHub Desktop.
position
/**
* position
*/
body {
padding:40px;
}
.parent {
position:relative;
padding:40px;
background:#EE0;
}
.child-1 {
position:absolute;
top:20px;
left:80px;
bottom:10px;
right:10px;
background:#00E;
/*height:100px;*/
margin:20px;
}
.child-2 {
background:#E00;
height:100px;
width:100px;
margin:20px;
}
<!-- content to be placed inside <body>…</body> -->
<div class="parent">
<div class="child-1"></div>
<div class="child-2"></div>
</div>
{"view":"split-vertical","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment