I want to center an object using CSS and no hacks, is this possible and how?
I have tried this, but than my p tag is gone.
.centered { position: fixed;
HTML:
Centered
CSS:
div { margin: 0 auto; width: 200px; }
Live example: http://jsfiddle.net/v3WL5/
Note that margin: 0 auto; will only have an effect if the div has a width.
margin: 0 auto;
div