D
D
Denis Kuzmin2019-05-23 17:39:08
Layout
Denis Kuzmin, 2019-05-23 17:39:08

How on flex to make the element on the left take up the entire free area in the container, and the element on the right has a width of 400px and is pressed to the right edge?

At the same time, the elements inside the left one were with a fixed width and aligned in the center.

<style>
   .flex {
      display: flex;
      width: 100vw;
      height: 100vh;
   }
   .elem {
      width: 100px;
      height: 100px;
   }
   .right {
      width: 400px;
   }
</style>
<div class="flex">
   <div class="left">
      <div class="elem"></div>
   </div>
   <div class="right"></div>
</div>

5ce6b1420e5e4078539501.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Ankhena, 2019-05-23
@DenKuzmin

https://jsfiddle.net/6geto47f/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question