I am trying to do something like following, that is specify the width of inner div as a percentage of the parent div.
<div>
<div style="width: 20%">
some text
</div>
<div style="width: 80%">
Some more text
</div>
</div>
How to do this so that the inner divs stay inside the parent div? I tried adding float to the inner divs. if I did that the inner divs go outside the parent div. I do not wish to specify width as pixels.
I saw the following: Setting Inner Div width's percentage of parent
What I am trying to do could be a bit different. I am open to using something like bootstrap to achieve this.