Skip to content

Instantly share code, notes, and snippets.

@ramsesoriginal
Created July 17, 2012 09:23
Show Gist options
  • Save ramsesoriginal/3128314 to your computer and use it in GitHub Desktop.
Save ramsesoriginal/3128314 to your computer and use it in GitHub Desktop.
Absolute positioning
/**
* Absolute positioning
*/
div {
margin:0;
padding:0;
border:0;
position: relative;
background-color: red;
min-width: 1px;
min-height:1px;
display: inline-block;
}
div div{
background-color: blue;
}
div span {
position: absolute;
top: 50px;
left: 10px;
background-color: yellow;
}
<!-- content to be placed inside <body>…</body> -->
<div>
<div style="width: 100px; height: 100px">
asd
</div>
<span>
lorem Ipsum
</span>
</div>
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment