I\'ve seen a million questions about how to center a block element and there seem to be a couple popular ways to do it, but they all rely on fixed pixels widths. Then either
Something like this could be it?
SOMETHING
body{
text-align: center;
}
.random{
width: 60%;
margin: auto;
background-color: yellow;
display:block;
}
DEMO: http://jsfiddle.net/t5Pp2/2/
Edit: adding display:block doesn't ruin the thing, so...
You can also set the margin to: margin: 0 auto 0 auto; just to be sure it centers only this way not from the top too.