Closed xptodevx closed 2 years ago
Hi @atul4a2l
I'm a little bit late to the party, but this might help others as well. This is not an issue with angularx-qrcode but rather a general CSS styling thing, I added some sample code for the centering and three buttons to the demo-app to control this. You can find the code starting with 12.0.3 in projects/demo-app
.
..
Adding a className to the component with the right styles might fix your issue.
[allowEmptyString]="true"
[className]="yourClassName">
[elementType]="elementType"
[errorCorrectionLevel]="errorCorrectionLevel"
[qrdata]="qrdata"
[scale]="scale"
[width]="width"
</qrcode>```
whereas yourClassName is a CSS class:
.left { display: flex; flex: 1; justify-content: left; }
.center { display: flex; flex: 1; justify-content: center; }
.right { display: flex; flex: 1; justify-content: right; }
HTH
The QR code is generated ok but I can't make it on the center regardless what I try is always on the left.
I'm on the latest Angular 11.