Problem with <input type='text' /> and <textarea> width

后端 未结 6 737
感情败类
感情败类 2020-12-19 03:04

In the following code, both the INPUT and TEXTAREA elements render wider than they should. How can I limit them to 100% of the usable area within the div?

&         


        
6条回答
  •  无人及你
    2020-12-19 03:32

    Inputs and textareas both have borders by default

    
    

    will render all the elements within your container.

    Update

    IE also has left and right padding on each element and the following css fits all the elements within the container in FF3, FF2, Safari 3, IE6 and IE7.

    
    

    However, don't forget that you will probably need a border, and perhaps the padding too, in order to make the fields appear to users as normal. If you set that border and padding yourself then you will know what the difference is, across browsers, between the width of the container and the width you will need to give to the input/textarea elements.

提交回复
热议问题