search

Home  >  Q&A  >  body text

What is the difference between HTML tags and elements?

I've noticed that most people use the words "HTML tag" and "HTML element" interchangeably.

But what is the difference between them?

I think the tag is in the source code and the element is the tag in the DOM that is processed (by the browser). am I wrong?

P粉447002127P粉447002127337 days ago547

reply all(2)I'll reply

  • P粉214176639
  • P粉413307845

    P粉4133078452024-02-22 00:36:48

    HTML tags simply open or close entities. For example:

    <p> and </p> are called HTML tags

    HTML elements include start tags, end tags, and content (no content tag is optional) For example:

    <p>This is the content</p>: This complete thing is called an HTML element

    reply
    0
  • Cancelreply