, . Of course, there are a few that do not appear in pairs, such as
,
, etc. The tag is used to mark HTML elements. The text between the start tag and the end tag is the content of the HTML element.
3. Attributes:?
HTML attributes provide various additional information for HTML elements, which are always in the form of name-value pairs such as "attribute name = attribute value" appears, and attributes are always defined in the opening tag of an HTML element.
?
Title ? ?hhhhhhhhhh
??
In this example,
this is The example page
is an HTML element, where "hhhhhhhhhh" is the specific content of the element. and so on are HTML tags, which constitute HTML elements. The bgcolor=#f00" in is the attribute of the tag, which defines how the tag should be configured specifically.In short, you don’t need to pay too much attention to the difference between elements and tags. In fact, At work, we all refer to tags directly, and attributes are easy to understand. It is to add various additional information or configuration options to HTML tags. For example, HTML is a family, and each HTML tag is a member of this family. , they each have their own tasks, such as div, p, etc.;
Each member has their own characteristics, and the name of this characteristic (for example: height, weight, hobbies, etc.) is similar to HTML attributes width, height, border, etc.; the specific values ??of these characteristics (for example: 180cm, 50kg, reading, etc.) are similar to the HTML attribute values ??100px, 10px, solid #f00.