Skip to content

34.前端页面有哪三层构成,分别是什么?作用是什么? #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
webVueBlog opened this issue Mar 14, 2020 · 2 comments
Labels
HTML&CSS HTML&CSS

Comments

@webVueBlog
Copy link
Member

No description provided.

@webVueBlog webVueBlog added the HTML&CSS HTML&CSS label Mar 14, 2020
@webVueBlog
Copy link
Member Author

网页的结构层(structural layer)由 HTMLXHTML 之类的标记语言负责创 建。

标签,也就是那些出现在尖括号里的单词,对网页内容的语义含义做出了描述, 但这些标签不包含任何关于如何显示有关内容的信息。

例如,P 标签表达了这样一种 语义:“这是一个文本段。”

网页的表示层(presentation layer) 由 CSS 负责创建。

CSS 对“如何显示有 关内容”的问题做出了回答。

网页的行为层(behavior layer)负责回答“内容应该如何对事件做出反应”这 一问题。

这是 Javascript 语言和 DOM 主宰的领域。

使用 (X)HTML 去搭建文档的结构。
使用 CSS 去设置文档的呈现效果。
使用 DOM 脚本去实现文档的行为。

@webVueBlog
Copy link
Member Author

The structural layer of a web page is created by a markup language such as HTML or XHTML.

Tags, or words that appear in Angle brackets, describe the semantic meaning of web content, but they don't contain any information about how to display the content.

For example, the P tag expresses the semantics: "this is a text segment."

The presentation layer is created by CSS.

CSS answers the question "how to display content".

The behavior layer of a web page answers the question, "how should content react to events?"

This is where the Javascript language and the DOM dominate.

Use (X)HTML to structure the document.
Use CSS to set the rendering of the document.
DOM scripts are used to implement the behavior of the document.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HTML&CSS HTML&CSS
Projects
None yet
Development

No branches or pull requests

1 participant