Force align a content in center

center, css, html

Solution

If your content doesn't have a fixed width do this:

<div class="content">
 <div class="inner">some content</div>
</div>


.content
{
 text-align: center;
}
.inner
{
 display:inline-block;
}

If it does, you could do this:

.content
{
 width: xpx;
 margin: 0 auto;
}

Problem

I have some content which will contain some divisions, labels, forms in it. I want to force them in the center of page. How can I do this? Note: I tried using `<div align="center">`, `<center>` but nothing works?

Original source