P
P
patashok2018-02-01 11:35:34
css
patashok, 2018-02-01 11:35:34

Why doesn't justify-content work?

Here is the html:

<div class="third-row">
  <div class="orange-bg">
    <div class="flex">
      <h1>Creative<br> design<br> services</h1>
      <div class="black-item">
      </div>
    </div>
  </div>
</div>


Here is the CSS:

section.first .third-row {
  border-top: 1px solid black;
  border-bottom: 1px solid black;
  padding: 15px 0;
}
section.first .third-row .orange-bg {
  width: 100%;
  height: 375px;
  background: linear-gradient(145deg, #fd9b00, #e14f00);
}
section.first .third-row .orange-bg .flex {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
section.first .third-row .orange-bg .flex h1 {
  font-size: 85px;
  font-family: nevisBold;
  color: #f4f4f4;
  text-transform: uppercase;
  line-height: 0.9;
}
section.first .third-row .orange-bg .flex .black-item {
  width: 440px;
  height: 40px;
  background: #090909;
}


Why doesn't it work ? However, when I remove it, everything is fine. justify-content: space-betweenflex-direction: column

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Egor Zhivagin, 2018-02-01
@patashok

This is a column, you need to set its height. Otherwise, how does it calculate the padding between elements?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question