how to fix alignment using flex box
hello I am trying to create a patient details modal. First Name and Last Name looks good but age, sex is not align with the first name and last name and phone email too but city and state is okay with first name and last name.
9 Replies
unable to send the code so sharing screenshot of the code
there's instructions on sharing code in #How To Ask Good Questions
sir I tried to follow the rules but dont know where i amm wrong. I need helo with field alignments
not necessarily a rule, just a helpful list of tips 🙂 people are more likely to help with code they can run, or at least read and/or copy paste.
Sure sir will do that in a minute by dividing every parts
to answer your question, flexbox isn't really made to fix alignments, by default it gives elements the space they want within the row they're in and different rows have no influence on each other. You can force them to align by setting widths on the elements, but that's potentially bad practice.
it's probably easier to use grid in this case, because grids will align by columns and rows
git it sir thanks a lot
thanks a lot sir, manage to do it with the grid
nice, glad you got it fixed!