0
I have the following html code:
<div class='pai'>
<div class='filho1'> Texto Qualquer que eu não sei o tamanho de caracteres </div>
<div class='filho2'> Componente que deve preencher a largura restante </div>
</div>
I need '.Filho1' to have its size according to its content and that . Fil2 fill in the remaining space until it reaches the '.pai' width limit.'
I know div . Fil1 and . Fil2 inherit the properties of the parent so I left css as follows
.pai{
margin: 0;
padding: 0;
width: 100%;
}
.filho1{
width: auto;
background-color: red;
}
.filho2{
width: 100%;
background-color: red;
}
however I want child 2 to be the size of ( (100% of .parent) - (width of .child 1) ) and I’m having a hard time.
I didn’t know about the flex property, but that’s exactly what I needed, thank you very much .
– le314u
a div can be a flex container and at the same time a flex item ?
– le314u
You can. Do a read on this link: https://origamid.com/projects/flexbox-fullguide/
– Rodrigo Carvalho de Brito