R
R
rmfan992018-08-03 21:28:59
Layout
rmfan99, 2018-08-03 21:28:59

Need to align a block?

5b649e1d1a9db727146892.png
Hello, I can’t center the block horizontally, preferably in Flex, please help!!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
emkorshunov, 2018-08-03
@emkorshunov

1. You make the general block (as I understand it, it will be a form) a flex container:
display: flex;
2. Wrap each label with its inputs in divs or paragraphs, or directly wrap the inputs with labels. They will be flex items.
3. In order for flex items to wrap to a new line, allow the flex container to wrap elements:
flex-wrap: wrap;
4. Set the width of the block and the width of the elements so that they fit 2 elements wide.
5. Well, the distribution of elements in the line can be set along the edges (set at the container):
justify-content: space-between;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question