This question already has an answer here:
这个问题已经有了答案:
- How to horizontally center a <div> in another <div>? 84 answers
-
如何在另一个
中水平居中a?84的答案
Code thus far:
代码到目前为止:
#master {
position: absolute;
height: auto;
width: 1000px;
min-height: 50px;
}
I want to center the tag horizontally, but not the task. What code do I need to add to do this?
我想水平居中标记,而不是任务。我需要添加什么代码来实现这一点?
1 个解决方案
#1
4
Add the following to your css rules
在css规则中添加以下内容
margin: 0 auto;
This will horizontally center block level elements.
这将是水平居中的块级别元素。
#1
4
Add the following to your css rules
在css规则中添加以下内容
margin: 0 auto;
This will horizontally center block level elements.
这将是水平居中的块级别元素。