0

I have this problem where my Flexbox does not expand if i add a margin or padding to the content(in this case the buttons) I dont want to set a fixed width of the second flex-item because i loose responsiveness if i do so, is there any way i can accomplish it without?

.flex-container {
  background-color:blue;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: space-around;
  align-items: center;
  align-content: stretch;
}

.flex-items:nth-child(1) {
  display: block;
  flex-grow: 0;
  flex-shrink: 1;
  flex-basis: auto;
  align-self: auto;
  order: 0;
}

.flex-items:nth-child(2) {
  display: block;
  flex-grow: 0;
  flex-shrink: 1;
  flex-basis: auto;
  align-self: auto;
  order: 0;
}

button {
  background-color: brown;
  font-size: 1.3rem;
  color: rgb(223, 223, 223);
  border: none;  
  margin: 0 5%;
}
<div class="flex-container">
  <h1 class="flex-items">test Header</h1>

  <div class="flex-items">
    <button>test</button>
    <button>test</button>
    <button>test</button>
  </div>
</div>

0 Answers0