Force align a content in center
问题 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? 回答1: 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; } 回答2: You must use margin