Skip to content

Instantly share code, notes, and snippets.

@exarcheia-web
Created November 26, 2013 20:05
Show Gist options
  • Save exarcheia-web/7665235 to your computer and use it in GitHub Desktop.
Save exarcheia-web/7665235 to your computer and use it in GitHub Desktop.
Position Property - Demo
/* Position Property - Demo */
.box {
height: 160px;
width: 400px;
background: red;
margin: 120px auto;
padding: 50px 10px;
text-align: center;
position: relative;
}
.circle {
height: 100px;
width: 100px;
background: green;
border-radius: 50%;
top: -50px;
left: 50%;
margin-left: -50px;
position: absolute;
}
img {
vertical-align: middle;
}
figure {
background: black;
text-align: left;
float: left;
}
/**
position
top, right, bottom, left, z-index
**/
<div class="box">
<div class="circle"></div>
<h2>Merry Christmas!</h2>
<figure><img src="http://placekitten.com/120/80"></figure>
</div>
// alert('Hello world!');
{"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