From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../glossary/\345\205\203\347\264\240/index.html" | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 "files/zh-cn/glossary/\345\205\203\347\264\240/index.html" (limited to 'files/zh-cn/glossary/元素') diff --git "a/files/zh-cn/glossary/\345\205\203\347\264\240/index.html" "b/files/zh-cn/glossary/\345\205\203\347\264\240/index.html" new file mode 100644 index 0000000000..d199da5b07 --- /dev/null +++ "b/files/zh-cn/glossary/\345\205\203\347\264\240/index.html" @@ -0,0 +1,22 @@ +--- +title: Element(元素) +slug: Glossary/元素 +tags: + - HTML + - XML + - 术语 + - 编程 +translation_of: Glossary/Element +--- +

元素是网页的一部分,在 {{glossary("XML")}} 和 {{glossary("HTML")}} 中,一个元素可以包含一个数据项,或是一块文本,或是一张照片,亦或是什么也不包含。 一个典型的元素包括一个具有一些{{glossary("attribute", "属性")}}的开始标签,中间的文本内容和一个结束标签。
+ Example: in <p class="nice">Hello world!</p>, '<p class="nice">' is an opening tag, 'class="nice"' is an attribute and its value, 'Hello world!' is enclosed text content, and '</p>' is a closing tag.

+ +

元素和{{glossary("tag", "标签")}}不是同一种概念。源代码中的标签用来标识元素的开始或结束,而元素是文档对象模型({{Glossary("DOM")}})中的一部分,文档对象模型会被{{glossary("browser", "浏览器")}}渲染、展示为页面。

+ +

相关信息

+ + -- cgit v1.2.3-54-g00ecf