i have html:
<div style="display:table; width: 90%"> <div style="display: table-row;"> <div style="display: table-cell;"><textarea>abcdefg</textarea></div> <div style="display: table-cell;"><textarea>hijklmn</textarea></div> </div> <div style="display: table-row;"> <div style="display: table-cell;"><textarea>abcdefg</textarea></div> <div style="display: table-cell;"><textarea>hijklmn</textarea></div> </div> </div>
when textarea
s small fits inside 90%. when increase size of textarea
s dragging them goes beyond 90% of browser window , scroll bar appears @ bottom.
is there way can limit maximum of 90% , won't extend more without using library using css can coded modern browser.
using max-width
stop table resizing if textareas resized enough table can still extend beyond it's 90% maximum, can stop behavior setting max-width
text areas themselves
<div style="display:table; width: 90%; max-width: 90%"> <div style="display: table-row;"> <div style="display: table-cell;"><textarea style="max-width: 45vh;">abcdefg</textarea></div> <div style="display: table-cell;"><textarea style="max-width: 45vh;">hijklmn</textarea></div> </div> <div style="display: table-row;"> <div style="display: table-cell;"><textarea style="max-width: 45vh;">abcdefg</textarea></div> <div style="display: table-cell;"><textarea style="max-width: 45vh;">hijklmn</textarea></div> </div> </div>
this isn't graceful fix it's inline styles , it's use of vw
(viewport width) units, should allow limit sizes need do, tweak further
Comments
Post a Comment