E
E
Evgeny Babkin2015-09-21 21:18:53
css
Evgeny Babkin, 2015-09-21 21:18:53

How to lay out this piece of the layout?

Good day. Gradually mastering flexbox. When laying out the layout, some questions arose:
1. How to lay out this piece of the layout using flex-box in order to keep this indent (red arrow) as on the layout (and is it even possible to control the distance between the elements of the flex block at your discretion?)
2. How position div.input in a way and set its width so that when the page size is reduced, it remains strictly in the middle (I applied relative positioning, centering left: 50% margin-left: - half the width, but when the viewport is reduced, the block gradually moves to the left side).
873682c2c2df4228a4b91e62b68535db.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
F
Fayozzhon Berdiev, 2015-09-21
@CybernatiC

margin:0 auto;

S
Sergey, 2015-09-21
@TsarS

And if you control the width like

-webkit-flex: 0 0 10%;
      -ms-flex: 0 0 10%;
          flex: 0 0 10%
 max-width: 10%;

H
htmleater, 2015-10-01
@htmleater

.flex-item:first-child {
flex: 0 0 200px; /*in any units*/
}
.flex-item:last-child {
flex: 1 1 auto;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question