简体   繁体   中英

how to put p-checkbox label from PrimeNG on the left of the checkbox

 <p-checkbox name="group1" [value]="true" label="Outsourcing"
                             style="margin: 0 25px"></p-checkbox>

On the default the labes is on the right of checkbox, how can I change it to be on the left?

You can achieve this by setting row-direction style property to row-reverse in p-checkbox element.

<p-checkbox 
  name="group1" 
  [value]="true" 
  label="Outsourcing" 
  style="margin: 0 25px; flex-direction: row-reverse">
</p-checkbox>

Working example: https://stackblitz.com/edit/angular-ivy-drzmxl?file=src/app/app.component.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM