0

Can someone explain to me, why when I set a width to the div tag, the width of the i icon is as I defined, but when I don't set a width to the div tag, the width of the icon is unpredictable?

The width of the icon is also changing depending on the length of the text of the paragraph.

(The section is inside a main tag in the body)

.about {
  display: flex;
}

.about div {
  display: flex;
  flex-direction: column;
}

main {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
<section class="about">
  <i class="glyphicon glyphicon-user"></i>
  <div>
    <h5>more text</h5>
    <p>
      Lorem ipsum dolor sit amet consectetur adipisicing elit. Odio iure fugit, illum quasi in, amet, iste id voluptatem exercitationem atque numquam aliquam libero saepe laboriosam impedit! Debitis, ipsa. Ducimus, deleniti?
    </p>
  </div>
</section>
Umutambyi Gad
  • 4,082
  • 3
  • 18
  • 39
guy
  • 111
  • 3
  • 9

0 Answers0