{"id":5240,"date":"2016-02-04T00:53:49","date_gmt":"2016-02-03T16:53:49","guid":{"rendered":"http:\/\/www.zhangxinxu.com\/wordpress\/?p=5240"},"modified":"2016-02-04T00:56:50","modified_gmt":"2016-02-03T16:56:50","slug":"html-textarea-rows-height","status":"publish","type":"post","link":"https:\/\/www.zhangxinxu.com\/wordpress\/2016\/02\/html-textarea-rows-height\/","title":{"rendered":"HTML textarea cols,rows\u5c5e\u6027\u548c\u5bbd\u5ea6\u9ad8\u5ea6\u5173\u7cfb\u7814\u7a76"},"content":{"rendered":"<p>by <a href=\"http:\/\/www.zhangxinxu.com\/\">zhangxinxu<\/a> from <a href=\"http:\/\/www.zhangxinxu.com\/\">http:\/\/www.zhangxinxu.com<\/a><br \/>\n\u672c\u6587\u5730\u5740\uff1a<a href=\"http:\/\/www.zhangxinxu.com\/wordpress\/?p=5240\">http:\/\/www.zhangxinxu.com\/wordpress\/?p=5240<\/a><\/p>\n<h3>\u4e00\u3001\u5173\u4e8etextarea\u5143\u7d20\u7684cols\u548crows\u5c5e\u6027<\/h3>\n<p><code>&lt;textarea&gt;<\/code>\u5143\u7d20\uff0c\u4fd7\u79f0\u201c\u6587\u672c\u57df\u201d\uff0c\u6216\u8005\u201c\u591a\u884c\u6587\u672c\u6846\u201d\uff0c\u5176\u81ea\u5e26\u539f\u751f\u7684HTML\u5c5e\u6027<code>rows<\/code>\u8868\u793a\u884c\u7684\u610f\u601d\uff0c\u53ef\u4ee5\u6539\u53d8<code>&lt;textarea&gt;<\/code>\u7684\u53ef\u89c6\u533a\u57df\u9ad8\u5ea6\uff0c<code>cols<\/code>\u8868\u793a\u5217\uff0c\u53ef\u4ee5\u6539\u53d8<code>&lt;textarea&gt;<\/code>\u7684\u53ef\u89c6\u533a\u57df\u5bbd\u5ea6\u3002\u4f8b\u5982\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>&lt;textarea&gt;&lt;\/textarea&gt;\n&lt;textarea cols=\"30\" rows=\"5\"&gt;&lt;\/textarea&gt;<\/pre>\n<\/div>\n<p><textarea><\/textarea><\/p>\n<p><textarea cols=\"30\" rows=\"5\"><\/textarea><\/p>\n<p>\u4f1a\u53d1\u73b0\uff0c\u4e0b\u9762\u7684\u5c3a\u5bf8\u660e\u663e\u6bd4\u6ca1\u6709<code>cols<\/code>\u548c<code>rows<\/code>\u5c5e\u6027\u503c\u7684\u8981\u5927\u3002<\/p>\n<p>\u4e0b\u9762\u95ee\u9898\u6765\u4e86\uff0c\u6211\u60f3\u5f88\u591a\u5c0f\u4f19\u4f34\u77e5\u9053<code>cols<\/code>\u548c<code>rows<\/code>\u53ef\u4ee5\u5f71\u54cd\u6587\u672c\u57df\u7684\u5c3a\u5bf8\uff0c\u90a3<code>cols<\/code>\u548c<code>rows<\/code>\u4e0d\u540c\u7684\u6570\u503c\u548c\u6700\u7ec8\u5c55\u793a\u7684\u50cf\u7d20\u5c3a\u5bf8\u4e4b\u95f4\u6709\u6ca1\u6709\u4ec0\u4e48\u5173\u7cfb\u5462\uff1f\u53ef\u4e0d\u53ef\u4ee5\u901a\u8fc7\u516c\u5f0f\u8ba1\u7b97\u5462\uff1f\u6700\u7ec8\u8868\u73b0\u662f\u5426\u8fd8\u53d7\u5230\u5176\u4ed6CSS\u5c5e\u6027\u7684\u5f71\u54cd\u5462\uff1f<\/p>\n<p>\u6211\u60f3\uff0c\u4ee5\u4e0a\u7684\u95ee\u9898\u5c31\u5f88\u5c11\u6709\u4eba\u77e5\u9053\u4e86\uff0c\u5305\u62ec\u6211\u5728\u5185\uff0c\u5728\u5199\u6b64\u6587\u4e4b\u524d\uff0c\u4e5f\u662f\u6a21\u6a21\u7cca\u7cca\u7684\u4e86\u89e3\u3002<\/p>\n<div style=\"border:1px dashed #ccc; padding: 10px; background-color:#f5f7f8;\">\u4e0b\u9762\u8981\u626f\u70b9\u5e9f\u8bdd\u4e86\uff0c\u5199\u8fd9\u7bc7\u6587\u7ae0\u7684\u65f6\u5019\uff0c\u6211\u5176\u5b9e\u5185\u5fc3\u662f\u5b64\u72ec\u7684\u3002\u8fd9\u79cd\u611f\u89c9\u548c\u81ea\u5df1\u4e00\u4eba\u53bb\u8352\u91ce\u5bfb\u627e\u9493\u573a\u7684\u7ecf\u5386\u5f88\u50cf\uff0c\u4f60\u77e5\u9053\u524d\u65b9\u6709\u4e00\u6761\u6cb3\u6d41\uff0c\u81f3\u4e8e\u90a3\u91cc\u9002\u4e0d\u9002\u5408\u9493\u9c7c\uff0c\u662f\u4e0d\u77e5\u9053\u7684\uff0c\u4f60\u60f3\u8981\u77e5\u9053\u7ed3\u679c\uff0c\u5c31\u9700\u8981\u4eb2\u81ea\u53bb\u786e\u8ba4\u3002\u4f46\u662f\uff0c\u524d\u5f80\u6cb3\u5cb8\u7684\u9053\u8def\u4e4b\u524d\u6ca1\u6709\u4e00\u4e2a\u4eba\u8d70\u8fc7\uff0c\u4e5f\u5c31\u662f\u6ca1\u6709\u9053\u8def\uff0c\u800c\u62e6\u5728\u81ea\u5df1\u9762\u524d\u7684\u662f\u9f50\u4eba\u9ad8\u7684\u8352\u8349\u5730\uff0c\u5b83\u4eec\u662f\u90a3\u4e48\u9ad8\u90a3\u4e48\u8fdc\uff0c\u4f3c\u4e4e\u770b\u4e0d\u5230\u5934\uff0c\u4f60\u4e0d\u77e5\u9053\u8349\u5730\u4e2d\u6709\u4ec0\u4e48\u5371\u9669\uff0c\u6bd2\u86c7\u91ce\u732a\u968f\u65f6\u53ef\u80fd\u51fa\u73b0\u3002\u7136\u800c\uff0c\u8ffd\u968f\u81ea\u5df1\u7684\u70ed\u60c5\u7684\u5185\u5fc3\uff0c\u8fd8\u662f\u6bc5\u7136\u524d\u53bb\u5f00\u62d3\u8005\u672a\u77e5\u7684\u9053\u8def\uff0c\u8349\u6728\u957f\u5f97\u662f\u90a3\u4e48\u7684\u5bc6\u96c6\uff0c\u81ea\u5df1\u53ea\u80fd\u7528\u624b\u7528\u529b\u62e8\u5f00\u4ed6\u4eec\uff0c\u72e0\u72e0\u8e29\u5728\u811a\u4e0b\u624d\u80fd\u524d\u884c\uff0c\u957f\u7740\u5012\u523a\u7684\u830e\u85e4\uff0c\u5200\u7247\u822c\u7684\u53f6\u5b50\uff0c\u5728\u624b\u4e0a\u8138\u4e0a\u7559\u4e0b\u4e00\u4e2a\u4e2a\u4f24\u75d5\uff0c\u5f53\u4f60\u524d\u8fdb\u4e86\u4e00\u534a\uff0c\u5230\u4e86\u6574\u4e2a\u8352\u8349\u7247\u91ce\u4e2d\u95f4\u7684\u65f6\u5019\uff0c\u56db\u5468\u6ca1\u6709\u4e00\u4e2a\u4eba\uff0c\u53ea\u6709\u8f7b\u8f7b\u7684\u98ce\u62b9\u52a8\u8349\u53f6\u4ea4\u7ec7\u7684\u55e6\u55e6\u58f0\uff0c\u4e00\u80a1\u5b64\u72ec\u7684\u611f\u89c9\u6cb9\u7136\u800c\u751f\uff0c\u5728\u8fd9\u4e00\u523b\uff0c\u518d\u5f3a\u5927\u7684\u5185\u5fc3\u4e5f\u4f1a\u72b9\u8c6b\uff0c\u6211\u8981\u4e0d\u8981\u7ee7\u7eed\u524d\u8fdb\u2026\u2026<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201602\/chuanyue.jpg\" width=\"320\" height=\"289\" alt=\"\u7a7f\u8d8a\u8349\u5730\" class=\"alignnone\" \/><\/p>\n<p>\u5bf9\u554a\uff0c\u6211\u8981\u4e0d\u8981\u7ee7\u7eed\u524d\u8fdb\u5462\uff01\uff1f\u6700\u8fd1\u4e00\u6bb5\u65f6\u5019\uff0c\u6709\u4e00\u53e5\u8bdd\u5bf9\u6211\u5185\u5fc3\u51b2\u51fb\u5f88\u5927\uff0c\u800c\u4e14\u53cd\u590d\u88ab\u63d0\u53ca\uff0c\u5c31\u662f\u201c\u4f60\u505a\u8fd9\u4ef6\u4e8b\u60c5\u7684\u76ee\u7684\u662f\u4ec0\u4e48\uff1f\u201d<\/p>\n<p>\u201c\u62dc\u6258\uff0c\u4e0d\u8981\u641e\u8fd9\u4e48\u529f\u5229\uff0c\u522b\u641e\u8fd9\u4e48\u7d2f\u597d\u4e0d\u597d\uff0c\u6211\u5c31\u662f\u8ffd\u5bfb\u5185\u5fc3\uff0c\u6211\u5c31\u662f\u5174\u8da3\u4f7f\u7136\uff01\u201d\u6211\u5fc3\u91cc\u7684\u7b2c\u4e00\u53cd\u5e94\u662f\u8fd9\u6837\u7684\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201601\/2016-01-11_225315.png\" width=\"200\" height=\"240\" alt=\"\u5174\u8da3\u4f7f\u7136\" class=\"alignnone\" \/><\/p>\n<p>\u7136\u800c\uff0c\u5f53\u7a81\u7136\u62ac\u5934\uff0c\u53d1\u73b0\u5468\u56f4\u6ca1\u6709\u4e00\u4e2a\u4eba\uff0c\u6ee1\u662f\u8346\u68d8\u7684\u65f6\u5019\uff0c\u5185\u5fc3\u5c31\u4f1a\u72b9\u8c6b\uff0c\u597d\u6bd4\u8fd9\u7bc7\u6587\u7ae0\uff0c\u5982\u679c\u975e\u8981\u8bb2\u529f\u5229\uff0c\u8bb2\u76ee\u7684\uff0c\u771f\u7684\u6ca1\u4ec0\u4e48\uff0c\u6709\u4ef7\u503c\u5417\uff1f\u6709\u4eba\u5728\u610f\u5417\uff1f\u82b1\u51fa\u53bb\u7684\u65f6\u95f4\u503c\u5f97\u5417\uff1f\u4e3a\u4ec0\u4e48\u641e\u4e9b\u65e0\u4eba\u95ee\u6d25\u7684\u4e1c\u897f\uff1f\u4e3a\u4f55\u4e0d\u53bb\u5173\u6ce8\u65f6\u9ae6\u7684\u5bf9\u9879\u76ee\u6709\u5e2e\u52a9\u7684\u4e1c\u897f\uff1f\u4e3a\u4f55\u522b\u4eba\u5728\u5929\u4e0a\u98de\uff0c\u4f60\u8981\u5728\u8346\u68d8\u4e1b\u4e2d\u5b64\u72ec\u524d\u884c\u5462\uff1f\uff08\u4e0b\u9762\u89c6\u9891\uff1a\u8def\u4eba\u5728\u8857\u5934\u9ed1\u677f\u4e0a\u5199\u4e0b\u4ed6\u4eec\u8fd9\u8f88\u5b50\u6700\u5927\u7684\u9057\u61be\uff09<\/p>\n<p><script>var htmlVideo = '<object id=\"\" height=\"281\" style=\"visibility: visible; width: 500px; height: 281px;\" width=\"500\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"><param value=\"http:\/\/www.miaopai.com\/show\/jgNQtukNCdQpADPCGP3ySA__.swf\" name=\"movie\"><param value=\"high\" name=\"quality\"><param value=\"never\" name=\"allowScriptAccess\"><param value=\"true\" name=\"allowFullScreen\"><param value=\"playMovie=false&amp;auto=0&amp;adss=0&amp;autostart=false\" name=\"flashvars\"><param value=\"transparent\" name=\"wmode\"><embed id=\"\" height=\"281\" allowscriptaccess=\"never\" style=\"visibility: visible; width: 500px; height: 281px;\" pluginspage=\"http:\/\/get.adobe.com\/cn\/flashplayer\/\" flashvars=\"playMovie=true&amp;auto=0&amp;autostart=false\" width=\"500\" allowfullscreen=\"true\" quality=\"high\" src=\"http:\/\/www.miaopai.com\/show\/jgNQtukNCdQpADPCGP3ySA__.swf\" type=\"application\/x-shockwave-flash\" wmode=\"transparent\"><\/object>';<\/script><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201602\/2016-02-02_233127.jpg\" width=\"500\" height=\"281\" alt=\"\u89c6\u9891\u5c01\u9762\" onclick=\"this.className='hidden';this.parentNode.insertAdjacentHTML('afterend', htmlVideo);\" \/><\/p>\n<p>So, \u7edf\u7edfout\u53bb\u5427\uff0c\u6211\u7ee7\u7eed\u6211\u7684\u524d\u8fdb\uff0c\u7a7f\u8d8a\u672a\u66fe\u7a7f\u8d8a\u8fc7\u7684\u8349\u5730\uff0c\u524d\u5f80\u90a3\u53ec\u5524\u7b49\u5f85\u7684\u6cb3\u6d41\uff0c\u53d1\u73b0\u81ea\u5df1\u5411\u5f80\u7684\u5782\u9493\u5904\u5973\u5730\u3002<\/p><\/div>\n<h3>\u4e8c\u3001cols\u5c5e\u6027\u503c\u548c\u5bbd\u5ea6<\/h3>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a href=\"http:\/\/www.zhangxinxu.com\/study\/201602\/textarea-cols-width.html\" target=\"_blank\">textarea\u6587\u672c\u57dfcols\u5c5e\u6027\u548c\u5bbd\u5ea6\u5173\u7cfbdemo<\/a><\/p>\n<p>\u754c\u9762\u5982\u4e0b\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201602\/2016-02-03_223954.png\" width=\"556\" height=\"468\" alt=\"cols\u4e0e\u5bbd\u5ea6\u6d4b\u8bd5demo\" class=\"alignnone\" \/><\/p>\n<p>\u6211\u4eec\u53ef\u4ee5\u9009\u62e9\u4e0b\u62c9\u4fee\u6539\u6587\u672c\u57df\u7684\u6587\u5b57\u5c3a\u5bf8\uff0c\u5b57\u4f53\u4ee5\u53ca\u5b57\u7b26\u95f4\u8ddd\u7b49\uff0c\u770b\u770b\u4f1a\u4e0d\u4f1a\u5bf9\u6587\u672c\u57df\u7684\u5bbd\u5ea6\u9020\u6210\u5f71\u54cd\u3002\u7ed3\u679c\u7ed3\u8bba\u5982\u4e0b\uff1a<\/p>\n<table width=\"320\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" class=\"params_table\">\n<tr>\n<th scope=\"col\">&nbsp;<\/th>\n<th scope=\"col\">Chrome<\/th>\n<th scope=\"col\">IE<\/th>\n<th scope=\"col\">FireFox<\/th>\n<\/tr>\n<tr>\n<th scope=\"row\">font-size<\/th>\n<td align=\"center\"><img decoding=\"async\" src=\"\/study\/image\/ok.gif\"><\/td>\n<td align=\"center\"><img decoding=\"async\" src=\"\/study\/image\/ok.gif\"><\/td>\n<td align=\"center\"><img decoding=\"async\" src=\"\/study\/image\/ok.gif\"><\/td>\n<\/tr>\n<tr>\n<th scope=\"row\">font-family<\/th>\n<td align=\"center\"><img decoding=\"async\" src=\"\/study\/image\/error.gif\"><\/td>\n<td align=\"center\"><img decoding=\"async\" src=\"\/study\/image\/error.gif\"><\/td>\n<td align=\"center\"><img decoding=\"async\" src=\"\/study\/image\/ok.gif\"><\/td>\n<\/tr>\n<tr>\n<th scope=\"row\">letter-spacing<\/th>\n<td align=\"center\"><img decoding=\"async\" src=\"\/study\/image\/error.gif\"><\/td>\n<td align=\"center\"><img decoding=\"async\" src=\"\/study\/image\/ok.gif\"><\/td>\n<td align=\"center\"><img decoding=\"async\" src=\"\/study\/image\/ok.gif\"><\/td>\n<\/tr>\n<\/table>\n<p>\u53ef\u4ee5\u770b\u89c1\uff0cChrome\u6d4f\u89c8\u5668\u53ea\u53d7\u5230\u5b57\u7b26\u5927\u5c0f\u5f71\u54cd\uff0c\u5bf9\u5b57\u4f53\u548c\u5b57\u7b26\u95f4\u8ddd\u89c6\u800c\u4e0d\u89c1\uff1b\u800cFireFox\u6d4f\u89c8\u5668\u5219\u6bcf\u4e00\u4e2a\u90fd\u4f1a\u5f71\u54cd\u4e4b\uff1b\u800cIE\u6d4f\u89c8\u5668\u4e0d\u53d7\u5b57\u7b26\u95f4\u8ddd\u5f71\u54cd\u3002<\/p>\n<p>\u90a3\u6700\u5173\u5fc3\u7684\u95ee\u9898\u6765\u4e86\uff0c<code>cols<\/code>\u7684\u503c\u548c\u6700\u7ec8\u5448\u73b0\u7684\u5bbd\u5ea6\u6709\u6ca1\u6709\u4ec0\u4e48\u6bd4\u5982\u7684\u5173\u7cfb\u6216\u8005\u516c\u5f0f\u5462\uff1f<\/p>\n<p>\u5728simsun\u5b57\u4f53\uff0c\u4e5f\u5c31\u662f\u5b8b\u4f53\u4e0b\uff0c\u6211\u4eec\u53ef\u4ee5\u5f88\u5bb9\u6613\u5f97\u770b\u51fa\u4e4b\u95f4\u7684\u5173\u7cfb\u4e3a\uff1a<\/p>\n<ul>\n<li><strong>Chrome:<\/strong> 8px * cols + 17px<\/li>\n<li><strong>IE:<\/strong> 8px * cols + 17px<\/li>\n<li><strong>FireFox:<\/strong> 8px * cols + 29px<\/li>\n<\/ul>\n<p>\u7531\u4e8eCSS,HTML\u8fd9\u4e9b\u4e1c\u897f\u662f\u8001\u5916\u53d1\u660e\u7684\uff0c\u56e0\u6b64\uff0c<code>cols<\/code>\u6bcf\u4e2a\u5355\u4f4d\u76f8\u5bf9\u7684\u5bbd\u5ea6\u662f\u76f8\u5bf9\u4e8e\u82f1\u6587\u5b57\u7b26\u800c\u8a00\u7684\uff0c\u5728\u5b8b\u4f53\u4e0b\uff0c\u53ef\u4ee5\u8ba4\u4e3a\u662f<code>8px<\/code>\uff0c\u540e\u9762\u7684<code>17px<\/code>\u5176\u5b9e\u5f88\u597d\u7406\u89e3\uff0c\u8868\u793a\u6eda\u52a8\u6761\u7684\u5bbd\u5ea6\u3002\u5728window\u7cfb\u7edf\u4e0b\uff0c\u9ed8\u8ba4\uff0c\u6240\u6709\u6d4f\u89c8\u5668\u7684\u6eda\u52a8\u6761\u6240\u5360\u636e\u7684\u5bbd\u5ea6\u90fd\u662f17\u50cf\u7d20\u3002\u6240\u4ee5\uff0c\u5bf9\u4e8eChrome\u548cIE\u6d4f\u89c8\u5668\u800c\u8a00\uff0c\u6587\u672c\u57df\u6700\u7ec8\u7684\u5bbd\u5ea6\uff08<code>padding<\/code>\u548c<code>border<\/code>\u5c3a\u5bf8\u6682\u4e0d\u8003\u8651\uff09\u5c31\u662f\u5355\u5b57\u7b26\u5bbd\u5ea6*<code>cols<\/code>\u503c+\u6eda\u52a8\u6761\u5bbd\u5ea6\u3002\u7136\u800c\uff0cFireFox\u6d4f\u89c8\u5668\u4e0b\uff0c\u589e\u52a0\u7684\u5bbd\u5ea6\u662f<code>29px<\/code>\uff0c\u8fd9\u4e2a\u4e0d\u5c31\u641e\u4e0d\u6e05\u695a\u95ee\u4ec0\u4e48\u662f<code>29px<\/code>\u4e86\u3002<\/p>\n<p>\u5728IE\u6d4f\u89c8\u5668\u4e0b\uff0c\u5982\u679c<code>&lt;textarea&gt;<\/code>\u7684<code>overflow<\/code>\u5c5e\u6027\u503c\u4e3a<code>hidden<\/code>, \u5219\u6ca1\u6709\u540e\u9762\u589e\u52a0\u7684<code>17px<\/code>\uff0c\u800c\u5176\u4ed6\u6d4f\u89c8\u5668\u6ca1\u6709\u6b64\u73b0\u8c61\u3002<\/p>\n<p>\u7136\u540e\uff0c\u5f53\u6211\u4eec\u4f7f\u7528\u5176\u4ed6\u5b57\u4f53\u7684\u65f6\u5019\uff0c\u6700\u7ec8\u7684\u5bbd\u5ea6\u8868\u73b0\u5219\u6bd4\u8f83\u5fae\u5999\u4e86\u3002\u56e0\u6b64\uff0c\u5355\u4e2a<code>cols<\/code>\u5bf9\u5e94\u7684\u5355\u4f4d\u5c31\u4e0d\u662f\u6574\u6570\u4e86\uff0c\u53ef\u80fd\u662f<code>8.1px<\/code>\u4e5f\u6709\u53ef\u80fd\u662f<code>7.7px~7.8px<\/code>\u8fd9\u6837\u5b50\u7684\u3002<\/p>\n<p><strong>\u603b\u7ed3\u4e00\u4e0b\u5c31\u662f\uff1a<\/strong><br \/>\n\u8c8c\u4f3c\u5728Chrome\u6d4f\u89c8\u5668\u4e0b\u624d\u6709\u70b9\u5b9e\u7528\u4ef7\u503c\uff0c\u56e0\u4e3a\u5176\u4ed6\u6d4f\u89c8\u5668\u4e0b\u7684\u5bbd\u5ea6\u6ce2\u52a8\u592a\u660e\u663e\uff0c\u4efb\u4f55\u5176\u4ed6\u73af\u5883\u7684\u53d8\u5316\u90fd\u4f1a\u5bfc\u81f4\u5bbd\u5ea6\u4e0d\u4e00\u6837\uff0c\u8fd9\u4e2a\u5176\u5b9e\u5728\u7f51\u9875\u5e03\u5c40\u4e2d\u662f\u5f88\u7cdf\u7cd5\u7684\u3002\u56e0\u4e3a\uff0c\u7f51\u9875\u662f\u81ea\u4e0a\u800c\u4e0b\u6d41\u5f0f\u7684\uff0c\u9ad8\u5ea6\u53ef\u4ee5\u5f88\u957f\u5f88\u957f\uff0c\u4f46\u662f\uff0c\u5bbd\u5ea6\u4e00\u822c\u662f\u56fa\u5b9a\u7684\uff0c\u8d44\u6e90\u6bd4\u8f83\u7d27\u5f20\uff0c\u8981\u6c42\u5e03\u5c40\u7cbe\u786e\uff0c\u56e0\u6b64\uff0c\u4e00\u65e6\u51fa\u73b0\u5bbd\u5ea6\u5728\u5404\u4e2a\u6d4f\u89c8\u5668\u4e0b\u4e0d\u4e00\u6837\u7684\u60c5\u51b5\uff0c\u52bf\u5fc5\u5927\u5927\u5f71\u54cd\u5176\u5b9e\u7528\u4ef7\u503c\u3002\u56e0\u6b64\uff0c\u5728\u5b9e\u9645web\u5236\u4f5c\u7684\u65f6\u5019\uff0c\u9664\u975e\u4e00\u4e9b\u5bf9\u5bbd\u5ea6\u8981\u6c42\u4e0d\u9ad8\u7684\u60c5\u51b5\uff0c\u5176\u4f59\u65f6\u5019\uff0c\u8fd8\u662f\u4f7f\u7528CSS <code>width<\/code>\u5c5e\u6027\u6765\u63a7\u5236\u6587\u672c\u57df\u7684\u5bbd\u5ea6\u3002<\/p>\n<h3>\u4e09\u3001rows\u5c5e\u6027\u503c\u548c\u9ad8\u5ea6<\/h3>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a href=\"http:\/\/www.zhangxinxu.com\/study\/201602\/textarea-rows-height.html\" target=\"_blank\">textarea\u6587\u672c\u57dfrows\u5c5e\u6027\u548c\u9ad8\u5ea6\u5173\u7cfbdemo<\/a><\/p>\n<p>\u754c\u9762\u5982\u4e0b\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201602\/2016-02-04_000514.png\" width=\"498\" height=\"587\" alt=\"rows\u4e0e\u9ad8\u5ea6demo\u754c\u9762\u622a\u56fe\" class=\"alignnone\" \/><\/p>\n<p>\u6211\u4eec\u53ef\u4ee5\u9009\u62e9\u4e0b\u62c9\u4fee\u6539\u6587\u672c\u57df\u7684\u6587\u5b57\u5c3a\u5bf8\uff0c\u5b57\u4f53\u4ee5\u53ca\u884c\u9ad8\u7b49\uff0c\u770b\u770b\u4f1a\u4e0d\u4f1a\u5bf9\u6587\u672c\u57df\u7684\u9ad8\u5ea6\u9020\u6210\u5f71\u54cd\u3002\u7ed3\u679c\u7ed3\u8bba\u5982\u4e0b\uff1a<\/p>\n<table width=\"320\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" class=\"params_table\">\n<tr>\n<th scope=\"col\">&nbsp;<\/th>\n<th scope=\"col\">Chrome<\/th>\n<th scope=\"col\">IE<\/th>\n<th scope=\"col\">FireFox<\/th>\n<\/tr>\n<tr>\n<th scope=\"row\">font-size<\/th>\n<td align=\"center\"><img decoding=\"async\" src=\"\/study\/image\/error.gif\"><\/td>\n<td align=\"center\"><img decoding=\"async\" src=\"\/study\/image\/ok.gif\"><\/td>\n<td align=\"center\"><img decoding=\"async\" src=\"\/study\/image\/error.gif\"><\/td>\n<\/tr>\n<tr>\n<th scope=\"row\">font-family<\/th>\n<td align=\"center\"><img decoding=\"async\" src=\"\/study\/image\/error.gif\"><\/td>\n<td align=\"center\"><img decoding=\"async\" src=\"\/study\/image\/ok.gif\"><\/td>\n<td align=\"center\"><img decoding=\"async\" src=\"\/study\/image\/error.gif\"><\/td>\n<\/tr>\n<tr>\n<th scope=\"row\">line-height<\/th>\n<td align=\"center\"><img decoding=\"async\" src=\"\/study\/image\/ok.gif\"><\/td>\n<td align=\"center\"><img decoding=\"async\" src=\"\/study\/image\/error.gif\"><\/td>\n<td align=\"center\"><img decoding=\"async\" src=\"\/study\/image\/ok.gif\"><\/td>\n<\/tr>\n<\/table>\n<p>\u53ef\u4ee5\u770b\u89c1\uff0cChrome\u6d4f\u89c8\u5668\u548cFireFox\u6d4f\u89c8\u5668\u53ea\u53d7\u5230\u884c\u9ad8\u5927\u5c0f\u5f71\u54cd\uff0c\u5bf9\u5b57\u4f53\u548c\u5b57\u7b26\u5927\u5c0f\u89c6\u800c\u4e0d\u89c1\uff1b\u800cIE\u6d4f\u89c8\u5668\u5374\u662f\u5b8c\u5168\u76f8\u53cd\u7684\u5904\u7406\uff0c\u5bf9<code>line-height<\/code>\u884c\u9ad8\u89c6\u800c\u4e0d\u89c1\uff0c\u4f46\u662f\uff0c\u5374\u5bf9\u5b57\u7b26\u5927\u5c0f\u548c\u5b57\u4f53\u6709\u5f71\u54cd\u3002<\/p>\n<p>\u90a3\u6700\u5173\u5fc3\u7684\u95ee\u9898\u6765\u4e86\uff0c<code>rows<\/code>\u7684\u503c\u548c\u6700\u7ec8\u5448\u73b0\u7684\u9ad8\u5ea6\u6709\u6ca1\u6709\u4ec0\u4e48\u6bd4\u5982\u7684\u5173\u7cfb\u6216\u8005\u516c\u5f0f\u5462\uff08\u5148\u4e0d\u8003\u8651<code>padding<\/code>\u548c<code>border<\/code>\u7684\u5f71\u54cd\uff09\uff1f<\/p>\n<p>\u5728Chrome\u6d4f\u89c8\u5668\u4e0b\uff0c\u6700\u7ec8\u7684\u9ad8\u5ea6\u5c31\u662f<code>rows<\/code>\u7684\u503c\u548c<code>line-height<\/code>\u884c\u9ad8\u7684\u4e58\u79ef\u3002\u6b63\u5982\u4e0a\u9762\u7684demo\u622a\u56fe\u6240\u793a\uff0c<code>rows<\/code>\u503c\u4e3a<code>2<\/code>\uff0c<code>line-height<\/code>\u4e3a<code>20px<\/code>\u7684\u65f6\u5019\uff0c\u6700\u540e\u7684\u9ad8\u5ea6\u662f<code>40px<\/code>, \u5c31\u662f\u4ed6\u4eec\u7684\u4e58\u79ef\u3002<\/p>\n<p>\u5728FireFox\u6d4f\u89c8\u5668\u4e0b\u4e5f\u662f\u7c7b\u4f3c\u7684\uff0c\u4f46\u662f\u6709\u4e00\u70b9\u4e0d\u540c\uff0c\u5c31\u662f\u9ad8\u5ea6\u9700\u8981\u518d\u628a\u6eda\u52a8\u6761\u7684\u5c3a\u5bf8\u8ba1\u7b97\u4e0a\u53bb\uff0c\u56e0\u6b64\uff0c\u662f\u4e0b\u9762\u8fd9\u5e45\u5149\u666f\uff0c\u9ad8\u5ea6\u90fd\u6bd4Chrome\u6d4f\u89c8\u5668\u9ad8<code>17px<\/code>:<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201602\/2016-02-04_002205.png\" width=\"416\" height=\"301\" alt=\"FireFox\u6d4f\u89c8\u5668\u4e0b\u7684\u9ad8\u5ea6\" class=\"alignnone\" \/><\/p>\n<p>\u5728IE\u6d4f\u89c8\u5668\u4e0b\uff0c\u9ad8\u5ea6\u4e0e\u884c\u9ad8\u6ca1\u5173\u7cfb\uff0c\u66f4\u50cf\u662f\u6709\u6587\u672c\u7684<code>content area<\/code>\u9ad8\u5ea6(inline box\u6a21\u578b\u4e2d\u7684\u6982\u5ff5)\u51b3\u5b9a\u7684\uff0c\u56e0\u4e3a\u5f53\u4e0d\u540c\u5b57\u4f53\u5207\u6362\u7684\u65f6\u5019\uff0c\u9ad8\u5ea6\u4e5f\u4f1a\u53d8\u9ad8\uff0c\u4f8b\u5982\uff0c\u4f7f\u7528\u5fae\u8f6f\u96c5\u9ed1\u5b57\u4f53\u5c31\u4f1a\u53d8\u9ad8\u5f88\u660e\u663e\uff0c\u800c\u5fae\u8f6f\u96c5\u9ed1\u7684<code>content area<\/code>\u9ad8\u5ea6\u5c31\u662f\u6bd4\u4e00\u822c\u5b57\u4f53\u8981\u9ad8\u3002\u56e0\u6b64\uff0c\u8981\u60f3\u786e\u5b9a\u6587\u672c\u57df\u9ad8\u5ea6\u5176\u4e0e\u5b57\u7b26\u4e4b\u95f4\u7684\u5173\u7cfb\uff0c\u5173\u952e\u5f88\u96be\u786e\u5b9a\u90a3\u4e2a\u8ba1\u7b97\u7cfb\u6570\uff1a\u9ad8\u5ea6=rows*\u7cfb\u6570\u3002\u4f8b\u5982\uff0c<code>16px<\/code>\u7684\u5fae\u8f6f\u96c5\u9ed1\u5b57\u4f53\u7684\u7cfb\u6570\u8fd1\u4f3c<code>21<\/code>\uff08\u89c1\u4e0b\u56fe\uff09\uff0c\u5b8b\u4f53simsun\u5219\u662f18.2~18.5\u4e4b\u95f4\u7b49\u3002<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201602\/2016-02-04_003952.png\" width=\"359\" height=\"236\" alt=\"\u9ad8\u5ea6\u7cfb\u6570\" class=\"alignnone\" \/><\/p>\n<p><strong>\u603b\u7ed3\u4e00\u4e0b\u5c31\u662f\uff1a<\/strong><br \/>\n\u517c\u5bb9\u6027\u8fd8\u662f\u4e00\u56e2\u7cdf\uff0c\u6ca1\u6709\u4efb\u4f55\u4e24\u4e2a\u6d4f\u89c8\u5668\u662f\u5b8c\u5168\u540c\u4e00\u8868\u73b0\u3002\u4f46\u662f\u6700\u7ec8\u8868\u73b0\u8bbe\u8ba1\u8981\u6bd4<code>cols<\/code>\u8981\u597d\u90a3\u4e48\u4e00\u70b9\u70b9\u3002\u66f4\u5173\u952e\u7684\u95ee\u9898\u662f\uff0c\u9ad8\u5ea6\u8fd9\u4e2a\u4e1c\u897f\u4e00\u822c\u8981\u6c42\u6ca1\u90a3\u4e48\u4e25\uff0c\u6240\u4ee5\uff0c\u6211\u4eec\u6709\u65f6\u5019\u4e0d\u60f3\u91cd\u65b0\u641e\u4e2aCSS\u786e\u8ba4\u6587\u672c\u57df\u7684\u9ad8\u5ea6\uff0c\u4f7f\u7528<code>rows<\/code>\u5c5e\u6027\u503c\u641e\u4e00\u4e0b\u4e5f\u662f\u53ef\u4ee5\u7684\u3002<\/p>\n<h3>\u56db\u3001\u6700\u540e\u7684\u7ed3\u675f\u8bed<\/h3>\n<p>\u6700\u540e\u7814\u7a76\u7684\u7ed3\u679c\u662f\uff0c\u517c\u5bb9\u6027\u5f88\u5dee\uff0c\u60f3\u8981\u5404\u4e2a\u6d4f\u89c8\u5668\u4e0b\u8868\u73b0\u4e00\u6a21\u4e00\u6837\u6210\u672c\u5f88\u9ad8\u3002\u56e0\u6b64\uff0c\u5982\u679c\u5bf9\u6587\u672c\u57df\u7684\u5e03\u5c40\u8981\u6c42\u6bd4\u8f83\u4e25\u683c\uff0c\u8fd8\u662f\u4f7f\u7528CSS <code>width<\/code>\/<code>height<\/code>\u5c5e\u6027\u7cbe\u786e\u63a7\u5236\u3002<\/p>\n<p>\u552f\u4e00\u7684\u6536\u83b7\u5c31\u662f\uff0c\u77e5\u9053\u4e86\u5404\u4e2a\u6d4f\u89c8\u5668\u5982\u4f55\u517c\u5bb9\u6027\u4e0d\u4e00\uff0c\u4ee5\u53ca\u6700\u7ec8\u5c3a\u5bf8\u5448\u73b0\u7684\u8ba1\u7b97\u65b9\u6cd5\uff0c\u76f8\u5173\u56e0\u7d20\u7b49\uff0c\u8bf4\u4e0d\u5b9a\uff0c\u5bf9\u4e8e\u65e5\u540e\u67d0\u4e2a\u529f\u80fd\u5b9e\u73b0\u63d0\u4f9b\u4e86\u4e0d\u4e00\u6837\u7684\u601d\u8def\u5462\uff01<\/p>\n<p>En\uff0cthat&#8217;s all!<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/mat1.gtimg.com\/www\/mb\/images\/face\/14.gif\" align=\"absmiddle\"><\/p>\n<p>\u672c\u6587\u4e3a\u539f\u521b\u6587\u7ae0\uff0c\u5305\u542b\u811a\u672c\u884c\u4e3a\uff0c\u4f1a\u7ecf\u5e38\u66f4\u65b0\u77e5\u8bc6\u70b9\u4ee5\u53ca\u4fee\u6b63\u4e00\u4e9b\u9519\u8bef\uff0c\u56e0\u6b64\u8f6c\u8f7d\u8bf7\u4fdd\u7559\u539f\u51fa\u5904\uff0c\u65b9\u4fbf\u6eaf\u6e90\uff0c\u907f\u514d\u9648\u65e7\u9519\u8bef\u77e5\u8bc6\u7684\u8bef\u5bfc\uff0c\u540c\u65f6\u6709\u66f4\u597d\u7684\u9605\u8bfb\u4f53\u9a8c\u3002<br \/>\n\u672c\u6587\u5730\u5740\uff1a<a href=\"http:\/\/www.zhangxinxu.com\/wordpress\/?p=5240\">http:\/\/www.zhangxinxu.com\/wordpress\/?p=5240<\/a><\/p>\n<p>\uff08\u672c\u7bc7\u5b8c\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"<p><code>&lt;textarea&gt;<\/code>\u5143\u7d20\uff0c\u4fd7\u79f0\u201c\u6587\u672c\u57df\u201d\uff0c\u6216\u8005\u201c\u591a\u884c\u6587\u672c\u6846\u201d\uff0c\u5176\u81ea\u5e26\u539f\u751f\u7684HTML\u5c5e\u6027<code>rows<\/code>\u8868\u793a\u884c\u7684\u610f\u601d\uff0c\u53ef\u4ee5\u6539\u53d8<code>&lt;textarea&gt;<\/code>\u7684\u53ef\u89c6\u533a\u57df\u9ad8\u5ea6\uff0c<code>cols<\/code>\u8868\u793a\u5217\uff0c\u53ef\u4ee5\u6539\u53d8<code>&lt;textarea&gt;<\/code>\u7684\u53ef\u89c6\u533a\u57df\u5bbd\u5ea6\u3002<\/p>\n<p>\u4e0b\u9762\u95ee\u9898\u6765\u4e86\uff0c\u6211\u60f3\u5f88\u591a\u5c0f\u4f19\u4f34\u77e5\u9053<code>cols<\/code>\u548c<code>rows<\/code>\u53ef\u4ee5\u5f71\u54cd\u6587\u672c\u57df\u7684\u5c3a\u5bf8\uff0c\u90a3<code>cols<\/code>\u548c<code>rows<\/code>\u4e0d\u540c\u7684\u6570\u503c\u548c\u6700\u7ec8\u5c55\u793a\u7684\u50cf\u7d20\u5c3a\u5bf8\u4e4b\u95f4\u6709\u6ca1\u6709\u4ec0\u4e48\u5173\u7cfb\u5462\uff1f\u53ef\u4e0d\u53ef\u4ee5\u901a\u8fc7\u516c\u5f0f\u8ba1\u7b97\u5462\uff1f\u6700\u7ec8\u8868\u73b0\u662f\u5426\u8fd8\u53d7\u5230\u5176\u4ed6CSS\u5c5e\u6027\u7684\u5f71\u54cd\u5462\uff1f<\/p>\n<p>\u672c\u6587\u5c31\u5c06\u89e3\u7b54\u4e0a\u9762\u7684\u8fd9\u4e9b\u7591\u60d1\uff0c\u4e00\u8d77\u8fdb\u53bb\u770b\u770b\u5427~<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[1041,243,1042,515,574],"_links":{"self":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/5240"}],"collection":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/comments?post=5240"}],"version-history":[{"count":0,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/5240\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/media?parent=5240"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/categories?post=5240"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/tags?post=5240"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}