Is there a simple way to make html textarea and input type text equally wide?

前端 未结 12 2724
萌比男神i
萌比男神i 2021-02-18 19:29

Is there a simple way of getting a HTML textarea and an input type=\"text\" to render with (approximately) equal width (in pixels), that works in different browsers?

A C

12条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-18 20:06

    Yes, there is. Try doing something like this:

    
    
    

    Both should equate to the same size. You can do it with absolute sizes (px), relative sizes (em) or percentage sizes.

提交回复
热议问题