SHARE

I don’t do much CSS , but yesterday while editing a CSS theme I needed to move a content from left to center. Like in HTML, I replaced float:left to float:center, But there was no effect in design after searching around I found that there is no such thing as float:center in CSS. One of the method was to use  this code:  ” float:33em 9px 25.6%; ” . Even after adding this code, the content I have tried to move did not move to center . Then after searching I found that it can be moved using margin and easy way to do that is putting this code:

margin-left: auto;
margin-right: auto;

and remove float: code. This will automatically put the content to the center.

Also read: Automatically add browser specific CSS3 Properties with CSSFX.js

I don’t do much CSS , but yesterday while editing a CSS theme I needed to move a content from left to center.