Reputation: 895
I am having a problem centering a div element. The div element that I am trying to center has the following styles applied to it:
width: 60%;
float:right;
margin-left: auto;
margin-right: auto;
min-width: 300px;
The only parent tag is the body tag which has the following styles applied to it:
width:100%;
overflow-x:hidden;
Instead of being centered, the element is aligned to the right. I previously had the element set to "float:left" and I didn't have a problem centering it, but when I changed it to "float:right" the element was no longer centered.
Upvotes: 1
Views: 4124