我有一个 div 我想在中心对齐,水平说。请注意,button
里面,可以在中心对齐......遗憾的是我不能为包装纸做同样的事情
HTML标记:
<div class="wrap">
<div class="grayContainer">
<div class="editor-label">
name:
</div>
<div class="editor-field">
james
</div>
<div class="editor-label">
last name:
</div>
<div class="editor-field">
bond
</div>
<div class="alignCenter">
<input type="submit" value="press me" class="" />
</div>
</div>
</div>
CSS标记:
.grayContainer {
padding: 15px 10px 10px 10px;
width: 450px;
background-color: #E7E7E7;
border: 2px solid #CCCCCC;
-moz-border-radius: 8px;
-webkit-border-radius: 8px;
border-radius: 8px;
box-shadow: 0px 0px 6px 2px #CCCCCC;
position:relative;
behavior: url(/PIE.htc);
}
.grayContainer label
{
float: left;
width: 200px;
text-align: right;
color: #656565;
/*font-size: 12px;*/
text-shadow: 0 1px 0 white;
padding: 8px 13px 10px 0;
}
.grayContainer .alignCenter
{
padding: 20px 0;
}
.alignCenter
{
text-align: center;
}
.wrap
{
margin: 0 auto;
}
提前致谢