当我写类似的东西时:
<table style="margin-left: 30px;" >
</table>
或者:
<div style="margin-left: 30px;">
<h:commandButton value="add" action="a"></h:commandButton>
<h:commandButton value="cancel" action="b" immediate="true"></h:commandButton>
</div>
边距正确显示。
但是当我写:
<table class="marg" >
</table>
或者:
<div class="marg">
<h:commandButton value="add" action="a"></h:commandButton>
<h:commandButton value="cancel" action="b" immediate="true"></h:commandButton>
</div>
有了这个规则:
.marg {
margin-left: 50px;
margin-top: 30px;
}
HTML 生成代码:
<table class="marg">
</table>
<div class="marg">
<input id="j_id1109917403_4227fec1:j_id1109917403_4227feb3" type="submit" value="add" name="j_id1109917403_4227fec1:j_id1109917403_4227feb3">
<input id="j_id1109917403_4227fec1:j_id1109917403_4227feae" type="submit" value="cancel" name="j_id1109917403_4227fec1:j_id1109917403_4227feae">
</div>
表格和按钮无边距显示。为什么 ?