I was taking a course of html and css and the teacher explained that flex property is the shorthand of flex grow,shrink and basis. Why using flex:1; on every children makes them to behave diffrently from flex: 1 1 auto; or flex-grow:1;. And another question, why if i call flex: 1 in the parent container this isn't inherited by the children.
div {
width: 1366px;
font-size: 30px;
color: #009e2a;
display: flex;
background-color: #c9663e;
gap: 30px;
}
.element1 {
background-color: red;
/* flex-grow: 1; */
flex: 1;
}
.element2 {
background-color: blue;
/* flex-grow: 1; */
flex: 1;
}
.element3 {
background-color: navy;
/* flex-grow: 1; */
flex: 1;
}
<div>
<p class="element1">ana are mere djskahdkahk</p>
<p class="element2">
da chiar are mere dasldsakjdfhaskfjgsaj dkjashdkasghkd dkjsahdkja, fajkfa.hdkjash
</p>
<p class="element3">ce tar dalkjjd klashe</p>
</div>