Set Width Of A Form Inside A Div, To The Max-width Of It's Parent
I have the following html code:
Solution 1:
Not realy sure, but maybe this is what you want:
<divstyle='float: left; width: 50%; background-color: #00243c;'><divstyle='float:right; max-width: 500px;'>
Lorem ipsum dolor sit amet, est montes vitae. Auctor ipsum nam est, phasellus id condimentum facilisis. Aliquam sem, pede nec ante. Magnis phasellus mi neque, nullam quis lobortis, tristique adipiscing at. Amet arcu, donec sodales elit quis odio, suspendisse pede natoque amet leo, ipsum ac vivamus, amet fusce eget. Tortor augue eget montes metus nullam.
</div></div><divstyle='float: left; width: 50%; background-color: orange;'><divstyle='float: left; width: 100%; max-width:500px;'><formstyle='width:100%;'><inputtype='text'value='test'style='width:100%'></form></div></div>
Solution 2:
You just have to remove the float from the wrapping div, because it just shouldn't float, It will stick to the left as you wish and will expand at max of 500 pixels. Yet I don't find this structure as a reasonable layout, just my thought.
https://jsfiddle.net/f864b29a/4/
<divstyle='max-width:500px;'><formstyle='width:100%;'><inputtype='text'value='test'style='width:100%'></form></div>
Post a Comment for "Set Width Of A Form Inside A Div, To The Max-width Of It's Parent"