Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

textarea resizes width but not height, why?

Tags:

html

css

textarea

Here's what I've tried:

<textarea name='text' spellcheck = "true" style="height: 4em; width: 80%;" id="wider"></textarea>

I've also tried setting height with px or with %, both of which don't work. I also tried the following in my css file (as well as setting height as %, px, or em in the css, which also didn't work):

#wider{
    width: 80%;
    height: auto;
}

I can adjust the width either with the inline style command or with the css no problem. Why should the height be different, and what else might I try?

Thanks for any suggestions.

update: I have also tried setting the rows property in both the in-line and the CSS style. I understand that inline will overrule CSS. I just want one to work. Right now width attribute is always adjusted to reflect my change, but the height always stays the same. Is there something else I should be looking at? Thanks again!

like image 596
Sunnyside Productions Avatar asked Sep 05 '25 16:09

Sunnyside Productions


1 Answers

In this case it turned out there was a "min-height" property tucked away for textareas in forms. Apparently the inline styling setting of height does not override the min-height property from the CSS file.

like image 83
Sunnyside Productions Avatar answered Sep 07 '25 07:09

Sunnyside Productions