Unable to set textarea width with CSS

前端 未结 8 1755
梦谈多话
梦谈多话 2021-02-07 00:00

I have attempted to use this CSS to set the width of my form elements:

input[type=\"text\"], textarea { width:250px; }

If you look at this Fire

8条回答
  •  情深已故
    2021-02-07 00:36

    This answer is three years late, but I'm posting it here just in case anyone else is trying to set the width in em's and not pixels and comes across this post (as I just did). Make sure the font-size is the same,

    e.g.

    input, textarea {
        font-size:12px; 
        width:20em; 
        padding:0; 
        margin:0 
    }
    

    otherwise the textarea may be a different size (true on FF12).

提交回复
热议问题