HTML in the content layer
IntroduzidoNesta aula
| English |
|---|
| metatag |
| stylesheet |
| viewport |
| anchor/ˈæŋkə/ |
Writing the content
- HTML builds the content layer. The exam asks you to write and edit tags for structure, media and links.
Head and body
- The head holds information about the page:
<title>, metatags 元标签, attached stylesheets 样式表, the default link target. - The body holds the displayed content.
- Metatags: charset, description, keywords, author, viewport 视口.
- With several stylesheets equally specific, the one attached last wins.
Where does the page title shown in the browser tab go?
Dificuldade 1/5 · Moedas 100 + pequeno bônus na primeira conclusão hoje
The head holds information about the page.
Body elements
<h1>–<h3>,<p>; lists<ol>,<ul>,<li>.- Tables
<table>,<tr>,<th>,<td>;colspan,rowspan; sizes in px or %. <img src alt width height>;<video controls>,<audio controls>;<div class>groups elements.
Match each metatag to its purpose.
Dificuldade 2/5 · Moedas 140 + pequeno bônus na primeira conclusão hoje
Metatags describe the page.
What does the alt attribute of an image do?
Dificuldade 1/5 · Moedas 100 + pequeno bônus na primeira conclusão hoje
Alternative text.
Bookmarks and hyperlinks
- Bookmark:
<h2 id="fees">. Link with an anchor 锚点<a>:
| to | code |
|---|---|
| bookmark | <a href="#fees"> |
| local page | <a href="contact.html"> |
| website | <a href="https://…"> |
<a href="mailto:…"> |
target="_blank"opens a new window;"_self"the same one; or a named window.
Which code links to a bookmark id="fees" on the same page?
Dificuldade 1/5 · Moedas 100 + pequeno bônus na primeira conclusão hoje
The # marks a bookmark.
File paths
- Relative:
images/logo.png, from the current page. Absolute:C:/Users/…, one computer only. - Use relative paths so links survive uploading.
Why should local pages use relative file paths?
Dificuldade 1/5 · Moedas 100 + pequeno bônus na primeira conclusão hoje
An absolute path points to one computer's folders.
Always give images alt text. It is needed for accessibility and when images fail to load.
Head = information about the page (title, metatags, stylesheets); body = content. Use correct tags for text, lists, tables and media; link with <a href> and id bookmarks; use relative paths.
O que deu errado? Somente a equipe do site vê isso.