【发布时间】:2012-01-24 21:44:16
【问题描述】:
我想将<div> 居中(我是HTML5 新手,<center> 标记已不复存在),并且一定要避免使用表格。到目前为止,这就是我为<div> 提供的 CSS:
#roundedcorner {
-moz-border-radius: 15px;
border-radius: 15px;
background-image: url(file:///Macintosh%20HD/Users/julesmazur/Desktop/TAN3.0/Photos/bodydivbg.png);
width: 960px;
left: 50%;
font-family: Ubuntu;
}
(对于任何好奇的人,Ubuntu 由 Google Web Fonts 提供)。
【问题讨论】:
-
当我需要居中某些东西时,我通常会参考这个页面:w3.org/Style/Examples/007/center.en.html