此页面需较新浏览器(支持 SharedArrayBuffer)。请升级 Chrome、Edge、Firefox 或 Safari 至最新版本。
注释
- 注释是写给你自己看的备注,不是给读者看的。
- 浏览器会忽略它 —— 它永远不会显示在页面上。
- 这样写:
<!-- this is a comment -->。
English
<!-- The header goes here -->
<h1>Welcome</h1>
<!-- TODO: add a photo below -->
标签套着标签
- HTML 标签会嵌套:一对标签可以放在另一对里面。
<div>是一个普通的盒子,你可以往里面放东西。- 把里面的标签缩进一点,嵌套关系就更容易看清。
English
<div>
<h2>My card</h2>
<p>Some text inside the box.</p>
</div>
常见错误
- 标签要嵌套,不能交叉:
<b><i>x</i></b>,绝不能<b><i>x</b></i>。 - 注释是
<!-- ... -->,浏览器会忽略。
现在轮到你
- 注释帮你理清思路,嵌套帮你搭出结构。
- 留一条注释,再把一个段落嵌套进
<div>里。
探索
Neat nesting = the tree
Indentation in your HTML mirrors the parent/child tree.
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
Leave a note for yourself. Add a comment, like <!-- TODO: add a photo -->.
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
Put the paragraph inside a box. Wrap it in a <div> … </div>.
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
Group the recipe. Put the <h2> and the <ul> together inside one <div>, and indent them inside it.