若是下述案例所使用的標籤你還不會,不要擔憂。
你將在下一章學習到這些標籤。html
全部 HTML 文檔必須是以這個類型聲明:<!DOCTYPE html>
。瀏覽器
HTML 文檔自己要以<html>
開始,以</html>
結束。學習
HTML 文檔在瀏覽器中可見的部分是在<body>
和</body>
之間。網站
<!DOCTYPEhtml> <html> <body> <h1>My First Heading</h1> <p>My first paragraph.</p> </body> </html>
HTML 標題的定義使用從<h1>
到<h6>
標籤:翻譯
<h1>This is a heading</h1> <h2>This is a heading</h2> <h3>This is a heading</h3>
HTML 段落的定義使用<p>
標籤:code
<p>This is a paragraph.</p> <p>This is another paragraph.</p>
HTML 連接的定義使用<a>
標籤:htm
<a href="http://www.longestory.com">This is a link</a>
連接是經過
href
屬性指定跳轉的地址。
屬性是用來給HTML元素提供額外的信息。教程
HTML 圖像的定義使用<img>
標籤。文檔
該標籤提供的屬性中,src 屬性表示圖像的地址,alt 屬性表示提示內容,width 和 height 屬性表示圖像顯示的大小。class
<img src="longestory.jpg" alt="longestory.com" width="104" height="142">
你將在後面的章節中學習到更多有關屬性的內容。
本文翻譯於《w3schools》網站提供的 HTML 教程。