<分区>
标签 css jsf primefaces
<分区>
我有两个 <p:commandButton>
里面的元素<h:form>
在我的 .xhtml 页面中。
如何使它们居中?
最佳答案
将它们包裹在一个 div 中或 span content and text-align: center that div.
<div class="form-group center">
<p:commandButton value="C1" action="#{login.login}" />
<p:commandButton value="C2" action="#{login.login}" />
</div>
<style>
.center {
text-align: center;
}
</style>
有很多方法可以实现这一点,也许研究 CSS 可以帮助我们更好地理解它。
有用的链接:https://www.w3.org/Style/Examples/007/center.en.html#block
关于css - 如何对齐窗体中的两个命令按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38033510/