Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I prevent the textarea from stretching beyond his parent DIV element? (google-chrome issue only)
    primarykey
    data
    text
    <p>How can I prevent the textarea from stretching beyond its parent DIV element?</p> <p>I have this textarea inside a table which is inside a DIV and it seems that it causes the entire table to stretch out of its bounds.</p> <p>You can see an example of the same situation even in a more simple case, just putting a text area inside a div (like what is used here in www.stackoverflow.com)</p> <p>You can see from the images below that the textarea can stretch beyond the size of its parent? How do I prevent this?</p> <p>I'm kind of new to CSS so I don't really know what CSS attributes should I be using. I tried several like <em>display</em>, and <em>overflow</em>. But they don't seem to do the trick. Anything else I might have missed?</p> <p><img src="https://i.stack.imgur.com/uVtrL.jpg" alt="the div section"></p> <p><img src="https://i.stack.imgur.com/hN9Ye.jpg" alt="the text area"></p> <p>UPDATE: HTML</p> <p>CSS</p> <pre><code>textarea { max-width: 50%; } #container { width: 80%; border: 1px solid red; } #cont2{ width: 60%; border: 1px solid blue; } ​ </code></pre> <p>If you put this code inside the <a href="http://jsfiddle.net" rel="noreferrer">http://jsfiddle.net</a>, you will see that they act differently. Although the textarea is limited to the percentage declared in its css style, it is still possible to get it to cause its parent table to be as large as it wants to be, and then you can see that it spills over its parent border. Any thoughts on how to fix this? ​</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload