<分区>
Possible Duplicate:
How can I center something if I don't know ahead of time what the width is?
我想知道如何在不知道宽度的情况下对齐 div 标签。这与其他问题不同,因为我不介意使用 <center>
标记,但它在 HTML 组 View 中似乎是“旧的”。请问<center>
标签以后还能用吗?
谢谢
<分区>
Possible Duplicate:
How can I center something if I don't know ahead of time what the width is?
我想知道如何在不知道宽度的情况下对齐 div 标签。这与其他问题不同,因为我不介意使用 <center>
标记,但它在 HTML 组 View 中似乎是“旧的”。请问<center>
标签以后还能用吗?
谢谢
最佳答案
我通常使用 width:auto
或 width:100%
而不是 margin:0 auto
;
但是您可以在下面的链接上看到详细信息,因为它几乎与您的问题相同!
关于html - 在不知道宽度的情况下对齐 DIV 标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8179319/