M
M
microf2017-08-29 14:30:28
css
microf, 2017-08-29 14:30:28

How to set fixed sidebar width?

Good afternoon. Making a fixed column on flexbox

.wrapper
 .sidebar
   li anchor
   li anchor
   li anchor
 .main

and correspondingly
.wrapper {
  height:100vh;
  display:flex;
}
.sidebar {
   flex: 1 0 200px;
    background: gray;
}
.main {
    flex: 1 1 auto;
  padding: 20px;
  overflow: auto;
}

But the sidebar is half the screen wide. Why?
code pen

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Pyrkin, 2017-08-29
@microf

flex-grow seems to be the block ratio

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question