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

后端 未结 6 739
感情败类
感情败类 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:35

    Add "padding-right:3px;" to the div so it reads as:

    Because you have added a border to the div that also counts as internal space of the div.

    The reason it works without the doc declaration is that the browser does not render the page as transitional XHTML but plain old html which has a different rendering method for div's etc.

提交回复
热议问题