此页面需较新浏览器(支持 SharedArrayBuffer)。请升级 Chrome、Edge、Firefox 或 Safari 至最新版本。
链接
- 点击链接,就会带你去另一个页面。
- 用
<a>标签(a是 anchor,锚点的意思)。 - 网址写在
href里:<a href="...">。
English
<a href="https://example.com">Visit Example</a>
href 是一个属性
href="..."是一个属性 —— 写在开始标签里的额外信息。<a>和</a>之间的文字,才是读者看到、点击的内容。- 用完整的网址,以
https://开头。
English
<p>Need facts? <a href="https://wikipedia.org">Look it up</a> now.</p>
常见错误
- 链接需要
href。 - 用
target="_blank"在新标签页打开链接。
现在你来试试
- 链接可以单独放,也可以放在句子里面。
- 下面各做一个。
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
Add a link to https://example.com with the words Visit Example.
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
Turn the words look it up into a link to https://wikipedia.org, without breaking the sentence.
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
Make the link to https://example.com open in a new tab by adding target="_blank" to the <a> tag.