HTML:
<div class="outer">
<div class="inner">
</div>
</div>
CSS:
.outer{
position:relative;
}
.inner{
width:100px;
position:absolute;
left:50%;
margin-left:-50px; //half of the width of the element/div/img etc.
}
HTML:
<div class="outer">
<div class="inner">
</div>
</div>
CSS:
.outer{
position:relative;
}
.inner{
width:100px;
position:absolute;
left:50%;
margin-left:-50px; //half of the width of the element/div/img etc.
}
Article Topic:Software Development - HTML / CSS
Date:May 22, 2014
Want me to help develop your next Ruby-on-Rails project or application?
Contact Me