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
  • 245,468
  • 26
  • 309
  • 415
Sheppard26
  • 181
  • 1
  • 4
  • 15

0 Answers0