1 <!doctype html> 2 <html lang='zh-cn'> 3 <head> 4 <meta charset='utf-8'> 5 <meta name='author' content='宋英傑'> 6 <meta name='keywords' content=''> 7 <meta name='description' content=''> 8 <title>textarea</title> 9 <style type='text/css'> 10 *eee{margin:0;padding:0;} 11 html{font-size:100px;} 12 body{font:0.14rem/1.5 Microsoft Yahei,Arial,'宋體','黑體';background:#FFF;} 13 </style> 14 </head> 15 <body> 16 <textarea readonly name="txtarea1" style="width:800px;height:400px;"> 17 註釋:在文本輸入區內的文本行間,用 "%OD%OA" (回車/換行)進行分隔。 18 <html> 19 <head> 20 </head> 21 <body> 22 效果測試專用; 23 不要用tab,集成上文的效果,神煩; 24 屬性: 25 disabled:不能操做此文本域; 26 readonly:字面; 27 autofocus:自動獲取文本域爲焦點 28 wrap:換行方式 29 soft顯示效果自動換行;提交數據不自動換行;(默認) 30 hard全自動換行 31 off: 32 physical=hard 33 virtual=soft 34 form:指定想關聯的form元素的id 35 placeholder:佔位符,無內容時顯示 36 required;表示此項目爲必須輸入項目(必填內容)。 37 樣式:固定高寬:1,resize:none;2,max-width:apx;,max-height:apx;;resize級別高於max 38 </body> 39 </html> 40 </textarea> 41 <form> 42 <textarea autofocus required name="txtarea2" placeholder="請輸入帳號" style="width:300px;height:200px;resize:none;max-width:300px;max-height:200px;"></textarea> 43 </form> 44 </body> 45 </html>