📜 ⬆️ ⬇️

We treat a 100% wide textarea that came under padding in IE (on Habré too)

Faced once again with the problem that arises when you try to set the 100% width of an element located in blocks that have non-zero paddings or margins. In the case of textarea, the following is obtained: at the first display, the width is set the way it was intended, nothing climbs anywhere, but just dialing something - the field expands beyond the block into which it is inserted (only IE).

This time, I didn’t intend to look for workarounds that do not contain indents and hacks (like "// width: 90%"), - the comment tree is not a place for distortions. I tried various options, but my input field was still partially hidden under the borders of the parent element (or climbed over it).

Remembered about Habr, got into the code, and there the form is thrust c. Hmm, I think, but why didn't it work for me? I open Habr in IE6 - it doesn't work here either:
')


As a result of trial and error, I came to this decision:

#comment_form .textarea { position: relative; height: 64px; margin-bottom: 8px; }
#comment_form .textarea textarea { position: absolute; width: 100%; height: 64px; }

Source: https://habr.com/ru/post/22764/


All Articles