HTML标签和元素之间有什么区别? [英] What is the difference between HTML tags and elements?
问题描述
我注意到大多数人会交替使用 HTML标记和 HTML元素.
I notice that most people use the words HTML tags and HTML elements interchangeably.
但是它们之间有什么区别?
But what is the difference between them?
我看到的方式是标签在源代码中,而元素是DOM中处理过的标签(通过浏览器).我错了吗?
The way I see it is that tags are in the source code and elements are processed tags (by the browser) in the DOM. Am I wrong?
推荐答案
HTML标记只是打开或关闭实体.例如:
HTML tag is just opening or closing entity. For example:
<p>
和</p>
被称为HTML标记
<p>
and </p>
are called HTML tags
HTML元素包含开始标签,结束标签,内容(无内容标签是可选的) 例如:
HTML element encompasses opening tag, closing tag, content (optional for content-less tags) Eg:
<p>This is the content</p>
:这个完整的东西称为HTML元素
<p>This is the content</p>
: This complete thing is called a HTML element
这篇关于HTML标签和元素之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!