Answer the question
In order to leave comments, you need to log in
Flexbox: Why is child element resized and how to fix it?
Good time of the day.
Learning Flexbox, ran into a problem. I divide the container into three parts using the flex-grow property . Code:
HTML:
<section class="top-nav">
<div class="part1">
<img src="img/logo.svg" alt="Logo">
</div>
<div class="part2">
</div>
<div class="part3">
</div>
</section>
.top-nav {
display: flex;
}
.part1 {
flex-grow: 1
}
.part2 {
flex-grow: 2
}
.part3 {
flex-grow: 1
}
Answer the question
In order to leave comments, you need to log in
I got to the bottom of the solution to the problem and it all consisted only in the fact that I did not read up about the properties of Flexbox. I know, sinner, sorry to bother you. However, maybe it will save someone :)
Solution: instead of the flex-grow property, you need to use the flex property
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question