Unable to set textarea width with CSS

前端 未结 8 1742
梦谈多话
梦谈多话 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:47

    Set width 100% and then use max-width:

         textarea { 
              width:100%;
              max-width:250px;
         }
    

    // removed margin and padding, you can add it if you want.

提交回复
热议问题