Home >Web Front-end >HTML Tutorial >What are HTML elements? A brief discussion on the grammatical rules of elements

What are HTML elements? A brief discussion on the grammatical rules of elements

奋力向前
奋力向前Original
2021-07-07 13:57:293322browse

What are HTML elements? This article will take you through HTML elements and introduce the grammatical rules of html elements.

What are HTML elements? A brief discussion on the grammatical rules of elements

Related recommendations: "What is CSS syntax? Detailed introduction to usage methods and rules

##HTML elements

HTML elements refer to from the start tag to the end tag all code.

For example:

e388a4556c0f65e1904146cc1a846bee94b3e26ee717c64999d7867364b1b4a3, this is an HTML element.

Code example

<head>
<body>
<p></p>
</body>
</html>

and content elements, I write it is this site

php中文网.

The content of the element is the content between the start tag and the end tag

Code example

<p>php中文网</p>

html Syntax rules for elements:

  • #html element starts with a start tag, also called a start tag

  • html element ends with an end tag, also called a closing tag

  • The content between the start tag and the end tag is the element content

  • Some elements without element content can be understood as empty elements. Empty elements are generally Close within the start tag, that is, end with the end of the start tag;

    Example

    0c6dc11e160d3b678d68754cc175188a is an empty element without a closing tag (0c6dc11e160d3b678d68754cc175188a Label definition wraps).

  • Most elements have attributes

  • Tags are not case sensitive, but the World Wide Web recommends lowercase

Example explanation

e388a4556c0f65e1904146cc1a846bee Element

<p>php中文网</p>

The element has a start tag

e388a4556c0f65e1904146cc1a846bee, a closing tag 94b3e26ee717c64999d7867364b1b4a3

The element content is:

php中文网

## The 6c04bd5ca3fcae76e30b72ad730ca86d element


<p>php中文网</p>

6c04bd5ca3fcae76e30b72ad730ca86d

element defines the body of the HTML document. This element has a start tag

6c04bd5ca3fcae76e30b72ad730ca86d

and an end tag 36cc49f0c466276486e50c850b7e4956The content of the element is:

e388a4556c0f65e1904146cc1a846beephp中文网94b3e26ee717c64999d7867364b1b4a3


100db36a723c770d327fc0aef2ce13b1 Element




<p>php中文网</p>


100db36a723c770d327fc0aef2ce13b1 # The ## element defines the entire HTML document.

This element has a start tag 100db36a723c770d327fc0aef2ce13b1

, and an end tag

73a6ac4ed44ffec12cee46588e518a5e. The element content is another HTML element (body

element)

93f0f5c25f18dab9d176bd4f6de5d30e element

< ;head>

The element is a container for all head elements

93f0f5c25f18dab9d176bd4f6de5d30e

The element must contain the title of the document and can contain scripts, styles, meta information and other more information.

The elements listed below can be used inside the 93f0f5c25f18dab9d176bd4f6de5d30e

element:

##b2386ffb911b14667cb8f0f91ea547a7
    (In the header, this element is required)
  • c9ccee2e6ea535a969eb3f532ad9fe89
  • #< ;base>

  • ##2cdf5bf648cf2f33323966d7f58a7f3f

  • ##e8e496c15ba93d81f6ea4fe5f55a2244

  • ##3f1c4e4b6b16bbbd69b2ee476dc4f83a

  • ##2b0b25ff593c5b6c03403dd6234ffb2c
  • All major browsers support
  • 93f0f5c25f18dab9d176bd4f6de5d30e
  • Tags

    ##Notes

Don’t forget to end the tag

Use lowercase tags

    Recommended learning:
  • HTML video tutorial

The above is the detailed content of What are HTML elements? A brief discussion on the grammatical rules of elements. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn