<style type="text/css"> body{ padding: 10px; } input,textarea{ width: 100%; } </style> <body> <input type="text" name="" id="" value="" /> <textarea rows="5" cols="50">....</textarea> <input type="submit" name="" id="" value="提交" /> </body>
運行結果如圖:

解決方案:
樣式表中添加css3的box-sizing屬性
*{ box-sizing: border-box; }
修改后運行結果如下:

