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

奋力向前
Release: 2021-07-13 09:14:43
Original
3134 people have browsed it

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:

, this is an HTML element.

Code example

  

Copy after login

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

php中文网

Copy after login
Copy after login

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


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

  • Most elements have attributes

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

Example explanation

Element

php中文网

Copy after login
Copy after login

The element has a start tag

, a closing tag

The element content is:

php中文网

## Theelement

php中文网

Copy after login

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

and an end tagThe content of the element is:

php中文网


Element

php中文网

Copy after login

# The ## element defines the entire HTML document.

This element has a start tag

, and an end tag

. Theelement content is another HTML element (body

element)

element

< ;head>

The element is a container for all head elements

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

element:

##
    (In the header, this element is required)