涓夊崄涔濄€佸墠绔疕TML
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了涓夊崄涔濄€佸墠绔疕TML相关的知识,希望对你有一定的参考价值。
鏍囩锛?a href='http://www.mamicode.com/so/1/%e8%b6%85%e9%93%be%e6%8e%a5' title='瓒呴摼鎺?>瓒呴摼鎺?/a> span html5 涓嶅悓 鏂囦欢 imp style ref
HTML浠嬬粛
1.Web鏈嶅姟鏈川
import socket sk = socket.socket() sk.bind(("127.0.0.1", 8080)) sk.listen(5) while True: conn, addr = sk.accept() data = conn.recv(8096) conn.send(b"HTTP/1.1 200 OK\r\n\r\n") conn.send(b"<h1>Hello world!</h1>") conn.close()
銆€銆€娴忚鍣ㄥ彂璇锋眰 --> HTTP鍗忚 --> 鏈嶅姟绔帴鏀惰姹?--> 鏈嶅姟绔繑鍥炲搷搴?--> 鏈嶅姟绔妸HTML鏂囦欢鍐呭鍙戠粰娴忚鍣?--> 娴忚鍣ㄦ覆鏌撻〉闈?/p>
2.HTML鏄粈涔?/strong>
- 瓒呮枃鏈爣璁拌瑷€锛圚ypertext Markup Language, HTML锛夋槸涓€绉嶇敤浜庡垱寤虹綉椤电殑鏍囪璇█銆?/li>
- 鏈川涓婃槸娴忚鍣ㄥ彲璇嗗埆鐨勮鍒欙紝鎴戜滑鎸夌収瑙勫垯鍐欑綉椤碉紝娴忚鍣ㄦ牴鎹鍒欐覆鏌撴垜浠殑缃戦〉銆傚浜庝笉鍚岀殑娴忚鍣紝瀵瑰悓涓€涓爣绛惧彲鑳戒細鏈変笉鍚岀殑瑙i噴銆傦紙鍏煎鎬ч棶棰橈級
- 缃戦〉鏂囦欢鐨勬墿灞曞悕锛?html鎴?htm
3.HTML涓嶆槸浠€涔?/strong>
銆€銆€HTML鏄竴绉嶆爣璁拌瑷€锛坢arkup language锛夛紝瀹冧笉鏄竴绉嶇紪绋嬭瑷€銆?/p>
銆€銆€HTML浣跨敤鏍囩鏉ユ弿杩扮綉椤点€?/p>
4.HTML鏂囨。缁撴瀯
鏈€鍩烘湰鐨凥TML鏂囨。锛?/p>
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <title>css鏍峰紡浼樺厛绾?span style="color: #0000ff;"></title> </head> <body> </body> </html>
- <!DOCTYPE html>澹版槑涓篐TML5鏂囨。銆?/li>
- <html>銆?lt;/html>鏄枃妗g殑寮€濮嬫爣璁板拰缁撴潫鐨勬爣璁般€傛槸HTML椤甸潰鐨勬牴鍏冪礌锛屽湪瀹冧滑涔嬮棿鏄枃妗g殑澶撮儴锛坔ead锛夊拰涓讳綋锛坆ody锛夈€?/li>
- <head>銆?lt;/head>瀹氫箟浜咹TML鏂囨。鐨勫紑澶撮儴鍒嗐€傚畠浠箣闂寸殑鍐呭涓嶄細鍦ㄦ祻瑙堝櫒鐨勬枃妗g獥鍙f樉绀恒€傚寘鍚簡鏂囨。鐨勫厓锛坢eta锛夋暟鎹€?/li>
- <title>銆?lt;/title>瀹氫箟浜嗙綉椤垫爣棰橈紝鍦ㄦ祻瑙堝櫒鏍囬鏍忔樉绀恒€?/li>
- <body>銆?lt;/body>涔嬮棿鐨勬枃鏈槸鍙鐨勭綉椤典富浣撳唴瀹广€?/li>
銆€銆€娉ㄦ剰锛氬浜庝腑鏂囩綉椤甸渶瑕佷娇鐢?nbsp;<meta charset="utf-8"> 澹版槑缂栫爜锛屽惁鍒欎細鍑虹幇涔辩爜銆傛湁浜涙祻瑙堝櫒浼氳缃?GBK 涓虹紪銆€銆€鐮侊紝鍒欎綘闇€瑕佽缃负 <meta charset="gbk">銆?/p>
5.HTML鏍囩鏍煎紡
- HTML鏍囩鏄敱灏栨嫭鍙峰寘鍥寸殑鍏抽敭瀛楋紝濡?lt;html>, <div>绛?/li>
- HTML鏍囩閫氬父鏄垚瀵瑰嚭鐜扮殑锛屾瘮濡傦細<div>鍜?lt;/div>锛岀涓€涓爣绛炬槸寮€濮嬶紝绗簩涓爣绛炬槸缁撴潫銆傜粨鏉熸爣绛句細鏈夋枩绾裤€?/li>
- 涔熸湁涓€閮ㄥ垎鏍囩鏄崟鐙憟鐜扮殑锛屾瘮濡傦細<br/>銆?lt;hr/>銆?lt;img src="1.jpg" />绛夈€?/li>
- 鏍囩閲岄潰鍙互鏈夎嫢骞插睘鎬э紝涔熷彲浠ヤ笉甯﹀睘鎬с€?/li>
鏍囩鐨勮娉曪細
- <鏍囩鍚?灞炴€?=“灞炴€у€?” 灞炴€?=“灞炴€у€?”……>鍐呭閮ㄥ垎</鏍囩鍚?gt;
- <鏍囩鍚?灞炴€?=“灞炴€у€?” 灞炴€?=“灞炴€у€?”…… />
鍑犱釜寰堥噸瑕佺殑灞炴€э細
- id锛氬畾涔夋爣绛剧殑鍞竴ID锛孒TML鏂囨。鏍戜腑鍞竴
- class锛氫负html鍏冪礌瀹氫箟涓€涓垨澶氫釜绫诲悕锛坈lassname锛?CSS鏍峰紡绫诲悕)
- style锛氳瀹氬厓绱犵殑琛屽唴鏍峰紡锛圕SS鏍峰紡锛?/li>
6.HTML娉ㄩ噴
鍗曡娉ㄩ噴锛?lt;!--娉ㄩ噴鍐呭-->
澶氳娉ㄩ噴锛?lt;!
--娉ㄩ噴鍐呭-->
7.HTML甯哥敤鏍囩
銆€銆€head鍐呭父鐢ㄦ爣绛?/p>
鏍囩 | 鎰忎箟 |
---|---|
<title></title> | 瀹氫箟缃戦〉鏍囬 |
<style></style> | 瀹氫箟鍐呴儴鏍峰紡琛?/td> |
<script></script> | 瀹氫箟JS浠g爜鎴栧紩鍏ュ閮↗S鏂囦欢 |
<link/> | 寮曞叆澶栭儴鏍峰紡琛ㄦ枃浠舵垨缃戠珯鍥炬爣 |
<meta/> | 瀹氫箟缃戦〉鍘熶俊鎭?/td> |
Meta鏍囩
Meta鏍囩浠嬬粛锛?/p>
- <meta>鍏冪礌鍙彁渚涙湁鍏抽〉闈㈢殑鍏冧俊鎭紙mata-information锛?閽堝鎼滅储寮曟搸鍜屾洿鏂伴搴︾殑鎻忚堪鍜屽叧閿瘝銆?/li>
- <meta>鏍囩浣嶄簬鏂囨。鐨勫ご閮紝涓嶅寘鍚换浣曞唴瀹广€?/li>
- <meta>鎻愪緵鐨勪俊鎭槸鐢ㄦ埛涓嶅彲瑙佺殑銆?/li>
meta鏍囩鐨勭粍鎴愶細meta鏍囩鍏辨湁涓や釜灞炴€э紝瀹冧滑鍒嗗埆鏄痟ttp-equiv灞炴€у拰name 灞炴€э紝涓嶅悓鐨勫睘鎬у張鏈変笉鍚岀殑鍙傛暟鍊硷紝杩欎簺涓嶅悓鐨勫弬鏁板€煎氨瀹炵幇浜嗕笉鍚岀殑缃戦〉鍔熻兘銆?nbsp;
1.http-equiv灞炴€э細鐩稿綋浜巋ttp鐨勬枃浠跺ご浣滅敤锛屽畠鍙互鍚戞祻瑙堝櫒浼犲洖涓€浜涙湁鐢ㄧ殑淇℃伅锛屼互甯姪姝g‘鍦版樉绀虹綉椤靛唴瀹癸紝涓庝箣瀵瑰簲鐨勫睘鎬у€间负content锛宑ontent涓殑鍐呭鍏跺疄灏辨槸鍚勪釜鍙傛暟鐨勫彉閲忓€笺€?/p>
<!--鎸囧畾鏂囨。鐨勭紪鐮佺被鍨?闇€瑕佺煡閬?--> <meta http-equiv="content-Type" charset=UTF8"> <!--2绉掑悗璺宠浆鍒板搴旂殑缃戝潃锛屾敞鎰忓紩鍙?浜嗚В)--> <meta http-equiv="refresh" content="2;URL=https://www.oldboyedu.com"> <!--鍛婅瘔IE浠ユ渶楂樼骇妯″紡娓叉煋鏂囨。(浜嗚В)--> <meta http-equiv="x-ua-compatible" content="IE=edge">
2.name灞炴€? 涓昏鐢ㄤ簬鎻忚堪缃戦〉锛屼笌涔嬪搴旂殑灞炴€у€间负content锛宑ontent涓殑鍐呭涓昏鏄究浜庢悳绱㈠紩鎿庢満鍣ㄤ汉鏌ユ壘淇℃伅鍜屽垎绫讳俊鎭敤鐨勩€?/p>
<meta name="keywords" content="meta鎬荤粨,html meta,meta灞炴€?meta璺宠浆"> <meta name="description" content="鑰佺敺瀛╂暀鑲睵ython瀛﹂櫌">
浜屻€乥ody鍐呭父鐢ㄦ爣绛?/strong>
鍩烘湰鏍囩锛堝潡绾ф爣绛惧拰鍐呰仈鏍囩锛?/h3>
<b>鍔犵矖</b>
<i>鏂滀綋</i>
<u>涓嬪垝绾?lt;/u>
<s>鍒犻櫎</s>
<p>娈佃惤鏍囩</p>
<h1>鏍囬1</h1>
<h2>鏍囬2</h2>
<h3>鏍囬3</h3>
<h4>鏍囬4</h4>
<h5>鏍囬5</h5>
<h6>鏍囬6</h6>
<!--鎹㈣-->
<br>
<!--姘村钩绾?-><hr>
<b>鍔犵矖</b>
<i>鏂滀綋</i>
<u>涓嬪垝绾?lt;/u>
<s>鍒犻櫎</s>
<p>娈佃惤鏍囩</p>
<h1>鏍囬1</h1>
<h2>鏍囬2</h2>
<h3>鏍囬3</h3>
<h4>鏍囬4</h4>
<h5>鏍囬5</h5>
<h6>鏍囬6</h6>
<!--鎹㈣-->
<br>
<!--姘村钩绾?-><hr>
鐗规畩瀛楃
鐗规畩瀛楃
鍐呭 | 瀵瑰簲浠g爜 |
---|---|
绌烘牸 | |
> | > |
< | < |
& | & |
¥ | ¥ |
鐗堟潈 | © |
娉ㄥ唽 | ® |
div鏍囩鍜宻pan鏍囩
div鏍囩鐢ㄦ潵瀹氫箟涓€涓潡绾у厓绱狅紝骞舵棤瀹為檯鐨勬剰涔夈€備富瑕侀€氳繃CSS鏍峰紡涓哄叾璧嬩簣涓嶅悓鐨勮〃鐜般€?br />span鏍囩鐢ㄦ潵瀹氫箟鍐呰仈(琛屽唴)鍏冪礌锛屽苟鏃犲疄闄呯殑鎰忎箟銆備富瑕侀€氳繃CSS鏍峰紡涓哄叾璧嬩簣涓嶅悓鐨勮〃鐜般€?/p>
鍧楃骇鍏冪礌涓庤鍐呭厓绱犵殑鍖哄埆锛?br />鎵€璋撳潡鍏冪礌锛屾槸浠ュ彟璧蜂竴琛屽紑濮嬫覆鏌撶殑鍏冪礌锛岃鍐呭厓绱犲垯涓嶉渶鍙﹁捣涓€琛屻€傚鏋滃崟鐙湪缃戦〉涓彃鍏ヨ繖涓や釜鍏冪礌锛屼笉浼氬椤甸潰浜х敓浠讳綍鐨勫奖鍝嶃€?br />杩欎袱涓厓绱犳槸涓撻棬涓哄畾涔塁SS鏍峰紡鑰岀敓鐨勩€?/p>
娉ㄦ剰锛?/strong>
鍏充簬鏍囩宓屽锛氶€氬父鍧楃骇鍏冪礌鍙互鍖呭惈鍐呰仈鍏冪礌鎴栨煇浜涘潡绾у厓绱狅紝浣嗗唴鑱斿厓绱犱笉鑳藉寘鍚潡绾у厓绱狅紝瀹冨彧鑳藉寘鍚叾瀹冨唴鑱斿厓绱犮€?/p>
p鏍囩涓嶈兘鍖呭惈鍧楃骇鏍囩锛宲鏍囩涔熶笉鑳藉寘鍚玴鏍囩銆?/p>
img鏍囩
<img src="鍥剧墖鐨勮矾寰? alt="鍥剧墖鏈姞杞芥垚鍔熸椂鐨勬彁绀? title="榧犳爣鎮诞鏃舵彁绀轰俊鎭? width="瀹? height="楂?瀹介珮涓や釜灞炴€у彧鐢ㄤ竴涓細鑷姩绛夋瘮缂╂斁)">
a鏍囩
瓒呴摼鎺ユ爣绛?/p>
鎵€璋撶殑瓒呴摼鎺ユ槸鎸囦粠涓€涓綉椤垫寚鍚戜竴涓洰鏍囩殑杩炴帴鍏崇郴锛岃繖涓洰鏍囧彲浠ユ槸鍙︿竴涓綉椤碉紝涔熷彲浠ユ槸鐩稿悓缃戦〉涓婄殑涓嶅悓浣嶇疆锛岃繕鍙互鏄竴涓浘鐗囷紝涓€涓數瀛愰偖浠跺湴鍧€锛屼竴涓枃浠讹紝鐢氳嚦鏄竴涓簲鐢ㄧ▼搴忋€?/p>
浠€涔堟槸URL锛? URL鏄粺涓€璧勬簮瀹氫綅鍣?Uniform Resource Locator)鐨勭缉鍐欙紝涔熻绉颁负缃戦〉鍦板潃锛屾槸鍥犵壒缃戜笂鏍囧噯鐨勮祫婧愮殑鍦板潃銆? URL涓句緥 http://www.sohu.com/stu/intro.html http://222.172.123.33/stu/intro.html URL鍦板潃鐢?閮ㄥ垎缁勬垚 绗?閮ㄥ垎锛氫负鍗忚锛歨ttp://銆乫tp://绛? 绗?閮ㄥ垎锛氫负绔欑偣鍦板潃锛氬彲浠ユ槸鍩熷悕鎴朓P鍦板潃 绗?閮ㄥ垎锛氫负椤甸潰鍦ㄧ珯鐐逛腑鐨勭洰褰曪細stu 绗?閮ㄥ垎锛氫负椤甸潰鍚嶇О锛屼緥濡?index.html 鍚勯儴鍒嗕箣闂寸敤“/”绗﹀彿闅斿紑銆?/pre>
<a href="http://www.oldboyedu.com" target="_blank" >鐐规垜</a>
href灞炴€ф寚瀹氱洰鏍囩綉椤靛湴鍧€銆傝鍦板潃鍙互鏈夊嚑绉嶇被鍨嬶細
- 缁濆URL - 鎸囧悜鍙︿竴涓珯鐐癸紙姣斿 href="http://www.jd.com锛?/li>
- 鐩稿URL - 鎸囧綋鍓嶇珯鐐逛腑纭垏鐨勮矾寰勶紙href="index.htm"锛?/li>
- 閿歎RL - 鎸囧悜椤甸潰涓殑閿氾紙href="#top"锛?/li>
target锛?/p>
- _blank琛ㄧず鍦ㄦ柊鏍囩椤典腑鎵撳紑鐩爣缃戦〉
- _self琛ㄧず鍦ㄥ綋鍓嶆爣绛鹃〉涓墦寮€鐩爣缃戦〉
鍒楄〃
1.鏃犲簭鍒楄〃
<ul type="disc"> <li>绗竴椤?lt;/li> <li>绗簩椤?lt;/li> </ul>
type灞炴€э細
- disc锛堝疄蹇冨渾鐐癸紝榛樿鍊硷級
- circle锛堢┖蹇冨渾鍦堬級
- square锛堝疄蹇冩柟鍧楋級
- none锛堟棤鏍峰紡锛?/li>
2.鏈夊簭鍒楄〃
<ol type="1" start="2"> <li>绗竴椤?lt;/li> <li>绗簩椤?lt;/li> </ol>
type灞炴€э細
- 1 鏁板瓧鍒楄〃锛岄粯璁ゅ€?/li>
- A 澶у啓瀛楁瘝
- a 灏忓啓瀛楁瘝
- 鈪犲ぇ鍐欑綏椹?/li>
- 鈪板皬鍐欑綏椹?/li>
3.鏍囬鍒楄〃
<dl> <dt>鏍囬1</dt> <dd>鍐呭1</dd> <dt>鏍囬2</dt> <dd>鍐呭1</dd> <dd>鍐呭2</dd> </dl>
琛ㄦ牸
琛ㄦ牸鏄竴涓簩缁存暟鎹┖闂达紝涓€涓〃鏍肩敱鑻ュ共琛岀粍鎴愶紝涓€涓鍙堟湁鑻ュ共鍗曞厓鏍肩粍鎴愶紝鍗曞厓鏍奸噷鍙互鍖呭惈鏂囧瓧銆佸垪琛ㄣ€佸浘妗堛€佽〃鍗曘€佹暟瀛楃鍙枫€侀缃枃鏈拰鍏跺畠鐨勮〃鏍肩瓑鍐呭銆?br />琛ㄦ牸鏈€閲嶈鐨勭洰鐨勬槸鏄剧ず琛ㄦ牸绫绘暟鎹€傝〃鏍肩被鏁版嵁鏄寚鏈€閫傚悎缁勭粐涓鸿〃鏍兼牸寮忥紙鍗虫寜琛屽拰鍒楃粍缁囷級鐨勬暟鎹€?br />琛ㄦ牸鐨勫熀鏈粨鏋勶細
<table> <thead> <tr> <th>搴忓彿</th> <th>濮撳悕</th> <th>鐖卞ソ</th> </tr> </thead> <tbody> <tr> <td>1</td> <td>Egon</td> <td>鏉犲</td> </tr> <tr> <td>2</td> <td>Yuan</td> <td>鏃ュぉ</td> </tr> </tbody> </table>
灞炴€?
- border: 琛ㄦ牸杈规.
- cellpadding: 鍐呰竟璺?/li>
- cellspacing: 澶栬竟璺?
- width: 鍍忕礌 鐧惧垎姣?锛堟渶濂介€氳繃css鏉ヨ缃暱瀹斤級
- rowspan: 鍗曞厓鏍肩珫璺ㄥ灏戣
- colspan: 鍗曞厓鏍兼í璺ㄥ灏戝垪锛堝嵆鍚堝苟鍗曞厓鏍硷級
form
鍔熻兘锛?/strong>
琛ㄥ崟鐢ㄤ簬鍚戞湇鍔″櫒浼犺緭鏁版嵁锛屼粠鑰屽疄鐜扮敤鎴蜂笌Web鏈嶅姟鍣ㄧ殑浜や簰
琛ㄥ崟鑳藉鍖呭惈input绯诲垪鏍囩锛屾瘮濡傛枃鏈瓧娈点€佸閫夋銆佸崟閫夋銆佹彁浜ゆ寜閽瓑绛夈€?/p>
琛ㄥ崟杩樺彲浠ュ寘鍚玹extarea銆乻elect銆乫ieldset鍜?label鏍囩銆?/p>
琛ㄥ崟灞炴€?/strong>
灞炴€?/th> | 鎻忚堪 |
---|---|
accept-charset | 瑙勫畾鍦ㄨ鎻愪氦琛ㄥ崟涓娇鐢ㄧ殑瀛楃闆嗭紙榛樿锛氶〉闈㈠瓧绗﹂泦锛夈€?/td> |
action | 瑙勫畾鍚戜綍澶勬彁浜よ〃鍗曠殑鍦板潃锛圲RL锛夛紙鎻愪氦椤甸潰锛夈€?/td> |
autocomplete | 瑙勫畾娴忚鍣ㄥ簲璇ヨ嚜鍔ㄥ畬鎴愯〃鍗曪紙榛樿锛氬紑鍚級銆?/td> |
enctype | 瑙勫畾琚彁浜ゆ暟鎹殑缂栫爜锛堥粯璁わ細url-encoded锛夈€?/td> |
method | 瑙勫畾鍦ㄦ彁浜よ〃鍗曟椂鎵€鐢ㄧ殑 HTTP 鏂规硶锛堥粯璁わ細GET锛夈€?/td> |
name | 瑙勫畾璇嗗埆琛ㄥ崟鐨勫悕绉帮紙瀵逛簬 DOM 浣跨敤锛歞ocument.forms.name锛夈€?/td> |
novalidate | 瑙勫畾娴忚鍣ㄤ笉楠岃瘉琛ㄥ崟銆?/td> |
target | 瑙勫畾 action 灞炴€т腑鍦板潃鐨勭洰鏍囷紙榛樿锛歘self锛夈€?/td> |
琛ㄥ崟鍏冪礌
鍩烘湰姒傚康锛?br />HTML琛ㄥ崟鏄疕TML鍏冪礌涓緝涓哄鏉傜殑閮ㄥ垎锛岃〃鍗曞線寰€鍜岃剼鏈€佸姩鎬侀〉闈€佹暟鎹鐞嗙瓑鍔熻兘鐩哥粨鍚堬紝鍥犳瀹冩槸鍒朵綔鍔ㄦ€佺綉绔欏緢閲嶈鐨勫唴瀹广€?br />琛ㄥ崟涓€鑸敤鏉ユ敹闆嗙敤鎴风殑杈撳叆淇℃伅
琛ㄥ崟宸ヤ綔鍘熺悊锛?br />璁块棶鑰呭湪娴忚鏈夎〃鍗曠殑缃戦〉鏃讹紝鍙~鍐欏繀闇€鐨勪俊鎭紝鐒跺悗鎸夋煇涓寜閽彁浜ゃ€傝繖浜涗俊鎭€氳繃Internet浼犻€佸埌鏈嶅姟鍣ㄤ笂銆?nbsp;
鏈嶅姟鍣ㄤ笂涓撻棬鐨勭▼搴忓杩欎簺鏁版嵁杩涜澶勭悊锛屽鏋滄湁閿欒浼氳繑鍥為敊璇俊鎭紝骞惰姹傜籂姝i敊璇€傚綋鏁版嵁瀹屾暣鏃犺鍚庯紝鏈嶅姟鍣ㄥ弽棣堜竴涓緭鍏ュ畬鎴愮殑淇℃伅銆?/p>
from django.conf.urls import url from django.shortcuts import HttpResponse def upload(request): print("request.GET:", request.GET) print("request.POST:", request.POST) if request.FILES: filename = request.FILES["file"].name with open(filename, 鈥榳b鈥? as f: for chunk in request.FILES[鈥榝ile鈥榏.chunks(): f.write(chunk) return HttpResponse(鈥樹笂浼犳垚鍔熲€? return HttpResponse("鏀跺埌浜嗭紒") urlpatterns = [ url(r鈥榐upload/鈥? upload), ]
input
<input> 鍏冪礌浼氭牴鎹笉鍚岀殑 type 灞炴€э紝鍙樺寲涓哄绉嶅舰鎬併€?/p>
type灞炴€у€?/th> | 琛ㄧ幇褰㈠紡 | 瀵瑰簲浠g爜 |
---|---|---|
text | 鍗曡杈撳叆鏂囨湰 | <input type=text" /> |
password | 瀵嗙爜杈撳叆妗?/td> | <input type="password" /> |
date | 鏃ユ湡杈撳叆妗?/td> | <input type="date" /> |
checkbox | 澶嶉€夋 | <input type="checkbox" checked="checked" /> |
radio | 鍗曢€夋 | <input type="radio" /> |
submit | 鎻愪氦鎸夐挳 | <input type="submit" value="鎻愪氦" /> |
reset | 閲嶇疆鎸夐挳 | <input type="reset" value="閲嶇疆" /> |
button | 鏅€氭寜閽?/td> | <input type="button" value="鏅€氭寜閽? /> |
hidden | 闅愯棌杈撳叆妗?/td> | <input type="hidden" /> |
file | 鏂囨湰閫夋嫨妗?/td> | <input type="file" /> |
灞炴€ц鏄?
- name锛氳〃鍗曟彁浜ゆ椂鐨?ldquo;閿?rdquo;锛屾敞鎰忓拰id鐨勫尯鍒?/li>
- value锛氳〃鍗曟彁浜ゆ椂瀵瑰簲椤圭殑鍊?
- type="button", "reset", "submit"鏃讹紝涓烘寜閽笂鏄剧ず鐨勬枃鏈勾鍐呭
- type="text","password","hidden"鏃讹紝涓鸿緭鍏ユ鐨勫垵濮嬪€?/li>
- type="checkbox", "radio", "file"锛屼负杈撳叆鐩稿叧鑱旂殑鍊?/li>
- checked锛歳adio鍜宑heckbox榛樿琚€変腑鐨勯」
- readonly锛歵ext鍜宲assword璁剧疆鍙
- disabled锛氭墍鏈塱nput鍧囬€傜敤
select鏍囩
<form action="" method="post"> <select name="city" id="city"> <option value="1">鍖椾含</option> <option selected="selected" value="2">涓婃捣</option> <option value="3">骞垮窞</option> <option value="4">娣卞湷</option> </select> </form>
灞炴€ц鏄庯細
- multiple锛氬竷灏斿睘鎬э紝璁剧疆鍚庝负澶氶€夛紝鍚﹀垯榛樿鍗曢€?/li>
- disabled锛氱鐢?/li>
- selected锛氶粯璁ら€変腑璇ラ」
- value锛氬畾涔夋彁浜ゆ椂鐨勯€夐」鍊?/li>
label鏍囩
瀹氫箟锛?lt;label> 鏍囩涓?input 鍏冪礌瀹氫箟鏍囨敞锛堟爣璁帮級銆?br />璇存槑锛?/p>
- label 鍏冪礌涓嶄細鍚戠敤鎴峰憟鐜颁换浣曠壒娈婃晥鏋溿€?/li>
- <label> 鏍囩鐨?for 灞炴€у€煎簲褰撲笌鐩稿叧鍏冪礌鐨?id 灞炴€у€肩浉鍚屻€?/li>
<form action=""> <label for="username">鐢ㄦ埛鍚?lt;/label> <input type="text" id="username" name="username"> </form>
textarea澶氳鏂囨湰
<textarea name="memo" id="memo" cols="30" rows="10"> 榛樿鍐呭 </textarea>
灞炴€ц鏄庯細
- name锛氬悕绉?/li>
- rows锛氳鏁?/li>
- cols锛氬垪鏁?/li>
- disabled锛氱鐢?/li>
以上是关于涓夊崄涔濄€佸墠绔疕TML的主要内容,如果未能解决你的问题,请参考以下文章
鐪嬪摥浜嗭紝鍓嶇蹇呯湅鐨?涓狧TML+CSS鎶€宸э紝鏀惰棌璧锋潵鍚э紒
銆愯禒绁?鎶樻墸鐮併€戠‘璁よ繃鐪肩锛屼綘鏄垜瑕佺瓑鐨勫墠绔汉锛?019绗?灞婁腑鍥藉墠绔紑鍙戣€呭ぇ浼氭潵鍟︼紒