Web development layers
IntroduzidoNesta aula
| English |
|---|
| content layer |
| presentation layer |
| border/ˈbɔːdə/ |
| external stylesheet |
| behaviour layer |
| scripting language |
Three jobs, three languages
- A web page is built in three layers: what it says, how it looks, and how it responds.
Content layer 内容层
- Enters the content and creates the structure: headings, paragraphs, tables, images, links.
- Language: HTML, e.g.
<h1>Opening times</h1>.
Match each layer to its language.
Dificuldade 2/5 · Moedas 140 + pequeno bônus na primeira conclusão hoje
Structure, look, action.
Presentation layer 表现层
- Displays and formats elements: colours, fonts, sizes, borders 边框, layout.
- Language: CSS, e.g.
h1 {color: navy;}. One external stylesheet 外部样式表 can restyle many pages.
Match each part of a web page to its layer.
Dificuldade 2/5 · Moedas 140 + pequeno bônus na primeira conclusão hoje
What it is, how it looks, what it does.
Changing a shared external stylesheet changes the look of every page that uses it.
Dificuldade 1/5 · Moedas 100 + pequeno bônus na primeira conclusão hoje
The content does not need to be touched.
Which is a job of the behaviour layer?
Dificuldade 1/5 · Moedas 100 + pequeno bônus na primeira conclusão hoje
Behaviour responds to the user.
Why separate content from presentation?
Dificuldade 1/5 · Moedas 100 + pequeno bônus na primeira conclusão hoje
One content layer, many presentations.
Behaviour layer 行为层
- A scripting language 脚本语言 such as JavaScript makes the page respond: pop-ups, slideshows, form checks.
Term-dates table: the table and dates are content (HTML); the blue header and borders are presentation (CSS); a button highlighting today is behaviour (script).
Colours and fonts are not content. Anything about appearance belongs in the presentation layer.
Content = HTML structure; presentation = CSS formatting; behaviour = scripts responding to users. Separating them lets one stylesheet restyle many pages and devices.
O que deu errado? Somente a equipe do site vê isso.