Skip to content

Instantly share code, notes, and snippets.

@devdays
Created February 16, 2015 21:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devdays/12878ed360db8f63b2c8 to your computer and use it in GitHub Desktop.
Save devdays/12878ed360db8f63b2c8 to your computer and use it in GitHub Desktop.
Demonstrating default behavior of absolute boxes
<div style="width: 300px; border: 1px solid blue">
<div style="position: absolute;
background-color: powderblue;">hello</div>
</div>
<div style="position: relative;">&nbsp;</div>
<div style="width: 300px; border: 1px solid red">
<div style="position: absolute;
background-color: lightgoldenrodyellow">hello there</div>
</div>
<div style="position: relative;">&nbsp;</div>
<div style="width: 300px; border: 1px solid green">
<div style="position: absolute;
background-color: lightgreen">Now is the time for all good men to come to the aid of their country. The quick fox jumped over the lazy dog.</div>
</div>
<div style="position: relative;">&nbsp;</div>
<div style="border: 1px solid green">
<div style="position: absolute; width: 300px;
background-color: lightgreen">Now is the time for all good men to come to the aid of their country. The quick fox jumped over the lazy dog.</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment