Skip to Content
MOBILE HTML5學習手冊
book

MOBILE HTML5學習手冊

by Estelle Weyl
June 2014
Intermediate to advanced
488 pages
9h 56m
Chinese
GoTop Information, Inc.
Content preview from MOBILE HTML5學習手冊
44
|
第二章
我們的第一個基本 HTML5 文件如下,值得一提的差異只有字元集(稍後說明)與文件
類型宣告:
<!DOCTYPE html>
<html>
<meta charset="UTF-8"/>
<head>
<title>My First HTML5 Web Page</title>
</head>
<body>
</body>
</html>
我們已經藉由這六個元件(DTD
<html>
根元素、
<head>
<meta>
字元集、
<title>
素,與
<body>
元素)建立一個空白的網頁,但它也算是一個網頁。拜
<title>
元素的內
容之賜,我們的空白網頁比許多網站更容易被搜尋引擎找到。
如前所述,你甚至不需要那麼多元素:
<!DOCTYPE html>
<meta charset="utf-8">
<title> My First HTML5 Web Page </title>
<p> Hello World
雖然這是一個合法的 HTML5 文件,但它不是一個好的實作方式。如果你採取明確的
方式來編寫程式,稍後維護你的程式的開發人員(包括你自己)將更容易知道程式的
含義。
<head> 裡面的元素
也許
<head>
是最不吸引人的網頁標記,因為在預設情況下,使用者無法看到它們。但它
不吸引人,不代表你可以忽略它。網頁文件的標頭是身為開發者的你告訴瀏覽器如何算
繪網頁的地方,也是你可以提示印表機、搜尋引擎與解析器如何處理內容的地方。
<head>
裡面,你一定看得到
<title>
,也可能會遇到
<meta>
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

JAVASCRIPT網頁應用程式設計

JAVASCRIPT網頁應用程式設計

Alex MacCaw

Publisher Resources

ISBN: 9789863471240