HTML标签和元素之间有什么区别? [英] What is the difference between HTML tags and elements?

查看:122
本文介绍了HTML标签和元素之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到大多数人会交替使用 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆