2
I’m trying to align two elements in the same line: one centered and the other at the end of the flex container.
I get the expected result with this code:
<div class="row">
<div class="d-flex w-25"></div>
<div class="d-flex justify-content-center w-50 my-2">
<h5>Cadastro</h5>
</div>
<div class="d-flex justify-content-end w-25 mt-2">
<p class="mt-1">Inativo</p>
<div>
<kendo-switch formControlName="xxx"></kendo-switch>
</div>
</div>
</div>
But I suppose it’s not good practice to use a flex-container
empty to align the h5
.
Is there any alternative with best practice to perform the alignment of these two items?
I tried to use w-75
in div
of h5
but it does not have the same effect, it is not totally centralized
It worked, I opted for the resolution with ml-auto because I suppose it is more didactic for other programmers
– veroneseComS
@Veronesecoms yes is the technique indicated! Just check the responsiveness of this as I commented, ml = margin-left, and auto = self :D
– hugocsl