Float removes your children DIV elements from a static document flow.
DIV elements being block-level
elements, unless set as inline
or inline-block
will not in any case apply to the parent's text-align
property.
You have more possibilities, the most common are:
.wrapper{
width: 720;
margin: 0 auto; /* keeps me centered */
overflow: auto; /* to contain floated child elements.
Or use a .clearfix http://nicolasgallagher.com/micro-clearfix-hack/ */
}
or using text-align: center;
.wrapper{
width: 720;
margin: 0 auto; /* keeps me centered (use anyways) */
text-align: center; /* my children are not block-level elements */
}
.leftCol{
display:inline-block;
width:200px;
/* text-align: left; probably you might want to reset text alignment */
}
.rightCol{
display: inline-block;
width:510px;
}
I would discourage you from using (in 2016.+) fixed widths. Use another more responsive unit like %
or vw