How to make a textbox and a textarea same width cross-browsers?

前端 未结 8 1473
孤街浪徒
孤街浪徒 2021-02-19 22:23

Setting the width of both the textbox (ie. input type=\"text\") and the textarea to 500px doesn\'t work in IE6 and Chrome, only works fine in FF2 (haven\'t tested other browsers

8条回答
  •  死守一世寂寞
    2021-02-19 22:55

    I also think that the problem is in border. Try defining the border style specifically for inputs/textarea together with their width.

    input, textarea{ border:1px solid grey; width:498px; }

    Also take a look in the source if input/textarea is not defined anywhere else or in their own tag (e.g. size or rows/cols). Other option when IE messes around is using special css file for it. However IMHO it shouldn't be necessary in your case.

提交回复
热议问题