Skip to content
Advertisement

Tag: resize

How can I resize element to fit its parent element?

I want to place the <input> element inside <td> without the <td> element being resized. These are my CSS codes: My JavaScript codes: I’m using this.body because these two codes are inside the class constructor. How can I solve this problem? I tried to use max-width and max-height, but they aren’t working. Answer Try to give your input position:relative, and

Creating a textarea with auto-resize

There was another thread about this, which I’ve tried. But there is one problem: the textarea doesn’t shrink if you delete the content. I can’t find any way to shrink it to the correct size – the clientHeight value comes back as the full size of the textarea, not its contents. The code from that page is below: Answer This

Advertisement