I\'m trying to make a centered div
with another div
on the right of it. So the div
on the left is horizontal centered. De div
This is using absolute positions. Please not that the amount of left:150px;
is the half width of centered div + half width of left div. Also the style margin-left:200px
; on the lef div, comes from the width of centered div.
.container {
position: relative;
}
.centered {
width: 200px;
background: #eeeeee;
position: absolute;
height: 100px;
margin: auto;
left: 0;
right: 0;
}
.leftOf {
background: #ff8800;
position: absolute;
left: 150px;
margin-left: 200px;
height: 100px;
width: 100px
}