Is it possible to center the left side (left border) of a child div within its parent div?
I tried using left: 50%
in the CSS for the child div, but it doesn't seem to be working. Can anyone explain why?
<div id="outher">
<div id="inner">
</div>
</div>
CSS:
#outher {
width: 1000px;
height: 1000px;
background-color: #ccc;
}
#inner {
width: 400px;
height: 300px;
background-color: #090;
left: 50%;
}
Check out the demo here