0

I do not know why by setting flex-direction to column my elements inside get width to 100%? I just want to make it vertical direction, but not wider. Can I do it without wrapping element in additional div? Please look at example below:

<button class="button">Good width</button>
<div class="flex-content">
  <button class="button">Wrong width</button>
</div>

.button {
  height: 36px;
}

.flex-content {
  display: flex;
  justify-content: center;
  flex-direction: column;
  width: 100%;
  border: 1px solid red;
}

https://codepen.io/anon/pen/QzGQQm

Regards

Temani Afif
  • 211,628
  • 17
  • 234
  • 311
Sheppard26
  • 171
  • 1
  • 3
  • 14

0 Answers0