V
V
Vladyslavvvv2020-09-05 01:38:08
css
Vladyslavvvv, 2020-09-05 01:38:08

How to properly position items on flexbox?

Hello, I have a task (I attach a picture). You need to lay out this template on flexbox. The question is how to make it so that there is space in the middle and these sidebars on the sides? It's just that I've got everything on top of each other and it doesn't work.
5f52c12885e22765237857.jpeg

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Steppp, 2020-09-05
@Steppp

<header></header>
<div>
  <div class="navidation"></div >
  <main></main>
  <aside></aside>
</div>
<footer></footer>

K
kryamk, 2020-09-05
@kryamk

<div class="wrap">
    <header class="header">Header</header>
    <main>
      <div class="left">Sidebar</div>
      <div class="center">main</div>
      <div class="right">Sidebar</div>
    </main>
    <footer class="footer">Footer</footer>
  </div>

* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}
.wrap {
  display: flex;
  flex-direction: column;
  height: 100vh;
}
main {
  display: flex;
  flex-grow: 1;
}
.center {
  flex-grow: 1;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question