The automatic adjustment on the left side of the form solves the problem of adding the width separately. Add the [html] vertical-align: middle; // The input box to display the text vertically in the center. I hope it will help you, you can leave a message if you have any questions about the code. [html] <! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN "" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <Html xmlns =" http://www.w3.org/1999/xhtml "> <Head> <title> automatic Width Adjustment on the left of the form </title> <meta http-equiv =" Content-Type "content =" text/html; charset = UTF-8 "/> <style type =" text/css "> label {float: left; margin-right: 2px; text-align: right; line-height: 26px;} span {margin-left: 4px;} input {border: 1px solid # ccc; height: 26px; line-height: 26px; vertical-align: middle ;} </style> <script type = "text/javascript" src =" http://jt.875.cn/js/jquery "> </Script> <script type =" text/javascript ">$ (function () {var max = 0; $ (" label "). each (function () {if ($ (this ). width ()> max) max = $ (this ). width () ;}); $ ("label "). width (max) ;}) </script>