Web development layers
導入済みこのレッスンの内容
| 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.
難易度 2/5 · 140 コイン + 今日初回達成時の小ボーナス
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.
難易度 2/5 · 140 コイン + 今日初回達成時の小ボーナス
What it is, how it looks, what it does.
Changing a shared external stylesheet changes the look of every page that uses it.
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
The content does not need to be touched.
Which is a job of the behaviour layer?
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
Behaviour responds to the user.
Why separate content from presentation?
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
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.
何が問題でしたか?この内容はサイトの運営チームだけが確認します。