Skip to content

A real web page

Web Basics — HTML & CSS Lesson 7 2:18 English narration · English + 中文 subtitles burned in

space play · ←/→ 5s · j/l 10s · f fullscreen · ,/. speed

Chapters

Transcript
So far you have written pieces of a page. 到目前为止,你写的都是页面的零件。
A real page puts them in a frame, and it is the same frame on essentially every website in the world, so it is worth meeting once. 一个真正的页面把它们放进一个框架里, 而世界上几乎每一个网站用的都是同一个框架,所以值得认识一次。
The doctype is the very first line, and it tells the browser this is modern HTML. doctype 是文件的第一行,它告诉浏览器:这是现代 HTML。
Then html wraps the whole document. 然后 html 包住整个文档。
And inside it are two rooms, one after the other: head, which holds information about the page, and body, which holds everything you can see. 而它里面有两个“房间”,一前一后: head,装着关于这个页面的信息; body,装着你能看见的一切。
Here is that skeleton as an actual file, and notice where your work from the last six lessons ends up. 这就是那个骨架写成真正文件的样子, 注意你前六课的成果落在了哪里。
Every heading, every paragraph, every list and link and image goes inside body. 每一个标题、每一个段落、每一个列表、链接和图片,都写在 body 里面。
Nothing changes about how you write them — they just now have a proper home. 它们的写法一点没变——只是现在有了一个正经的归属。
The page looks exactly as it did before, because body is the part a visitor sees, and that part is unchanged. 页面看起来和之前完全一样, 因为 body 就是访客看到的那部分,而那部分没有改动。
Head is for things that are about the page rather than on it, and the title is the one you can check right now. head 里放的是“关于这个页面”的东西,而不是“页面上”的东西, 而 title 是你现在马上就能验证的那一个。
It does not appear anywhere in the page itself. 它不会出现在页面里的任何地方。
It appears on the tab, at the top of the browser. 它出现在浏览器顶部的标签页上。
It is also the name that gets saved when someone bookmarks you, and the blue headline in a search result. 当别人把你的页面加入书签时,保存下来的也是这个名字, 搜索结果里那行蓝色标题也是它。
Every page should have one, and it should say what the page actually is. 每个页面都该有一个,而且它应该说清楚这个页面到底是什么。
Both tasks are about putting a line in the right place. 两道题都是关于把一行放在正确的位置上。
The title belongs inside head — put it in body and you have information in the wrong room, and the tab stays unnamed. title 属于 head 里面—— 把它放进 body,你就是把信息放错了房间,标签页也就没有名字。
And the doctype goes on line one, above html rather than inside it. 而 doctype 写在第一行,在 html 的上面,而不是里面。
It is not really a tag at all; it is a note to the browser, which is why it looks different from everything else you write. 它其实根本不是一个标签;它是给浏览器的一句说明, 这也是它看起来和你写的其它东西都不一样的原因。
Four things to take with you. 带走四点。
One: the doctype is the first line of the file. 第一:doctype 是文件的第一行。
Two: html wraps the whole document. 第二:html 包住整个文档。
Three: head holds information about the page, including its title. 第三:head 装着关于这个页面的信息,包括它的标题。
Four: body holds everything a visitor sees. 第四:body 装着访客看到的一切。
Now do both tasks — and from here on, write the frame first and fill in the body. 现在把两道题都做一下—— 从今往后,先写好这个框架,再往 body 里填内容。

Log in or create account

IGCSE, A-Level & AP