0
I have a <div>
with fixed values, and it has a <ul>
internally, as shown below:
<div id="personalizado">
<ul>
<li>item</li>
<li>item_extremamente_longo_que_força_o_elementoa_vazar_para_fora_da_pagina</li>
<li>item</li>
<li>item</li>
</ul>
</div>
div#personalizado{
width: 400px;
height: 300px;
}
ul{
/*inserir aqui o estilo*/
}
But I want the <ul>
or any other tag I insert after does not "leak" out, setting the maximum or minimum size of the child element according to the parent element properties. How can I do that?
What I imagine would be something like this:
#filho{
max-width: #pai:width;
}
And how would you like to display this content? What should happen to content that exceeds the width of the parent element?
– Woss
Guy is just you put max-width: 100% in direct children, but your question is may no context, because the son of the son can leave the grandmother, if the grandson has a fixed value in px for example he can leak the grandmother, it was not very clear, it would be better to explain the situation, because not always an answer will work for all cases....
– hugocsl
@hugocsl was more of a curiosity anyway, I saw places where I used the same properties of the parent element (or based on it) and thought maybe it would be interesting to use the parent attributes directly instead of setting them manually
– Arthur Siqueira
don’t you worry about it, treat each married, or things can easily get out of hand in your layout... my personal opinion...
– hugocsl