7
Despite the tag discontinuation <center>
, she still solved this my problem d eforma simple, but would like to know how to solve it just using css
.
The idea is to put two buttons (or div's
) at each end, and in the center put two buttons, as in the following image:
Using the tag <center>
, I did just the following:
<div style="float: left">
<p:commandButton .../>
</div>
<center>
<p:commandButton ..."/>
<p:commandButton .../>
</center>
<div style="float: right">
<p:commandButton .../>
</div>
Note: To div
that could put the two center buttons does not have a fixed size, can change dynamically, so I did not use the margin: 0 auto
.
How to do this using css
?
To the
position:absolute;
function correctly, the parent element shall be positioned at least withposition:relative;
, even so +1– Jader A. Wagner
@Jader updated as noted, grateful.
– Bacco
Yay! This is the simplest solution I’ve seen so far. @Bacco, thank you so much bro. : D
– Cold
What is the need of
overflow: hidden;
@Bacchus?– Cold
@Cold even took this case, I think it is force of habit that I have, for when I need to stick a float in the element it does not escape :). But remember that overflow:Hidden has the side effect of stretching the div to encompass content in some situations.
– Bacco