Grid CSS / PrimeFlex: label align-issue with horizontal forms
See original GitHub issue1) Environment
- PrimeFaces version: 7.1 (SNAPSHOT)
- Affected browsers: all browsers
2) Behavior
Grid CSS and PrimeFlex align labels on the upper left corner. This is not ideal. They should be baselined.
(Issue is not specific for babylon-theme.)
PrimeFlex offers CSS-class p-align-baseline to get this done right. But this has (at least) issues with SelectOneMenu:
<h3>Responsive (PrimeFlex, p-align-baseline)</h3>
<p:panelGrid columns="4" layout="flex" columnClasses="p-col-12 p-md-3 p-xl-2, p-col-12 p-md-9 p-xl-4, p-col-12 p-md-3 p-xl-2, p-col-12 p-md-9 p-xl-4" contentStyleClass="p-align-baseline ui-fluid">
<p:outputLabel for="text1" value="Text 1" />
<p:inputText id="text1" />
<p:outputLabel for="text2" value="Text 2" />
<p:inputText id="text2" />
<p:outputLabel for="date" value="Date" />
<p:datePicker id="date" showIcon="true" style="width:auto" />
<p:outputLabel for="checkbox" value="Checkbox" />
<p:selectBooleanCheckbox id="checkbox" itemLabel="Checkbox" />
<p:outputLabel for="text3" value="Text " />
<p:inputText id="text3" />
<p:outputLabel for="selectOne" value="SelectOne (misaligned)" />
<p:selectOneMenu id="selectOne">
<f:selectItem itemLabel="Select One" itemValue="" />
<f:selectItem itemLabel="Xbox One" itemValue="Xbox One" />
<f:selectItem itemLabel="PS4" itemValue="PS4" />
<f:selectItem itemLabel="Wii U" itemValue="Wii U" />
</p:selectOneMenu>
</p:panelGrid>
When we look to Bootstrap they solve this issue by offering the CSS-Class .col-form-label which add´s padding-top.
I´m currently not totaly sure what´s the best solution.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
label align-issue with horizontal forms - Prime Community Forum
When we look at https://www.primefaces.org/babylon/sample.xhtml labels are aligned at the top-left corner of the input. This is not ideal.
Read more >Center the whole form vertically and horizontally using ...
I'm using PrimeFlex@2.0.0 and PrimeNG@12.0.0. Snippet. <div class="p-grid-nogutter"> <div ...
Read more >Jsf Align Checkboxes In Panelgrid - ADocLib
Grid CSS / PrimeFlex: label align I have a panelGrid which contains description ... Grid CSS / PrimeFlex: label alignissue with horizontal forms...
Read more >How to Center Anything in CSS Using Flexbox and Grid
Table of Contents ->. How to Use Flexbox to. center anything horizontally; center anything vertically; center both horizontally & Vertically.
Read more >Bootstrap Horizontal alignment - examples & tutorial
Bootstrap 5 horizontal alignment utilities position elements on the x-axis. ... By using flexbox you can center the entire the column of the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@christophs78 I say we write a note in the documentation and then close this ticket.
@mertsincan came up with the following idea:
This is not pixel-perfect but quite good: