3

My goal is to have a text area that automatically resizes to whatever horizontal space is available after margins. Basically I am trying to align 160px on the left margin 50px on the right margin and then the textarea fills in the rest. Ive tried auto. I have also tried multiple combinations of positions, displays, nesting divs, and more. So far I have not been able to set the textarea to automatically fill the left and right space that is available. How can I accomplish this?

edit: it needs to fill the document width

1 Answer 1

3
<div style="margin:0 50px 0 160px"> <textarea style="width:100%">123</textarea> </div> 

Here is the code

Sign up to request clarification or add additional context in comments.

3 Comments

Does not work, 100% width always extends past document width: screensnapr.com/v/smw9GG.png
Sorry about that, had my old style left on the textarea, worked like a charm thanks :].
Try like this: <textarea style="width:200px;">123</textarea>

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.