DimaSan DimaSan - 4 months ago 5
CSS Question

How to align two commandButtons inside a form

I have two

elements inside
in my .xhtml page.
How to align them center?

enter image description here


Wrap them in a div or 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}" />
  .center {
    text-align: center;

There are many many ways to achieve this, and maybe looking into CSS could help understand it a bit more.

Helpful link: https://www.w3.org/Style/Examples/007/center.en.html#block