HTML(5) 涓嶈姹傛爣绛捐嚜闂悎
XHTML鏁欏鎴戜滑锛屾爣绛鹃兘鏄闂悎鐨勶紝涓嶈兘鍖呭惈瀛愬厓绱犵殑鏍囩闇瑕佽嚜闂悎銆備絾HTML5鏄病鏈夎繖涓姹傜殑锛屾墍鏈塇TML涓兘娌¤繖涓姹傦紝鏄疿HTML灏嗚繖闂ㄦ澗鏁g殑璇█鍙樺緱涓ユ牸璧锋潵銆俋HTML璇稿涓ユ牸锛屽寘鎷爣绛鹃兘瑕侀棴鍚堬紝鍖呮嫭tagName鍜屽睘鎬ч兘瑕佸皬鍐欑瓑銆
HTML 绗竴鐗
杩芥函HTML鐨鍏冪绗竴鐗锛屽氨鏄笉瑕佹眰鑷棴鍚堢殑锛屽涓嬬殑涓娈电敤娉曞氨琛ㄦ槑浜嗗叾鐨勬澗鏁i殢鎰
<ADDRESS> Newsletter editor<p> J.R. Brown<p> JimquickPost News, Jumquick, CT 01234<p> Tel (123) 456 7890 </ADDRESS>
瀵逛簬<img>杩欑被鏍囩锛屾湰鏉ュ氨鏄病鏈夐棴鍚堢殑锛屽師濮嬪畾涔変负锛
The IMG element is empty: it has no closing tag.
鐜拌鐨 HTML5
HTML5涓紝<br> <img> <input> <meta>绛夌┖鏍囩鍙互涓嶇敤鑷棴鍚堜簡銆
瀹樻柟鑽夋涓弿杩帮細
Then, if the element is one of the void elements, or if the element is a foreign element, then there may be a single U+002F SOLIDUS character (/). This character has no effect on void elements, but on foreign elements it marks the start tag as self-closing.
鍗宠嚜鍏抽棴鐨勬枩绾(/)瀵圭┖鏍囩鏃犳晥銆
Void Elements 鍖呭惈浠ヤ笅鏍囩锛
area, base, br, col, command, embed, hr, img, input, keygen, link, meta, param, source, track, wbr
瀹樻柟绛旂枒涓紝瀵硅闂強姝ら棶棰樼殑绛斿濡備笅锛
Void elements in HTML (e.g. the br, img and input elements) do not require a trailing slash. e.g. Instead of writing, you only need to write. This is the same as in HTML4. However, due to the widespread attempts to use XHTML1, there are a significant number of pages using the trailing slash. Because of this, the trailing slash syntax has been permitted on void elements in HTML in order to ease migration from XHTML1 back to HTML.
瑷鍗充笉鍐嶉渶瑕佽嚜闂悎(/)杩欎釜灏忓熬宸翠簡锛屽鏋滆鍐欎笂涔熸槸鍙互鐨勩
闄や簡MathML鏍囩閬靛惊XML璇硶闇瑕佽嚜闂悎澶栵紝鏅欻TML鏍囩涓嶈鑷棴鍚堟墠鏄爣鍑嗙殑鍐欐硶銆