- HTML is not a programming language, it is a markup language
- Several common nouns in HTML are elements, labels (opening and closing tags), attributes, element content
- This article is going to cover HTML elements
HTLM elements
The concept of elements
Example:
The result of the operation is:
Click to jump to BaiduAbove is a hyperlink example, click on the text above "Click to jump to Baidu", you can jump to the page of Baidu.
Now let's extract some of the code from the above code as follows:
<a href="http://www.baidu.com">点击跳转到百度</a>
An element typically includes tags, attributes (the name of the property and the value of the property), element content, so that part of the code is an element.
label |
property name |
property value |
element content |
< a > </A; |
href |
http://www.baidu . com |
Click to jump to Baidu |
Attention:
- Sometimes this is said, for example:< a > element . We know that < a >, </a >, < HTML >, < a > element ? In fact, it is not too tangled, this is only two different statements, the habitual term is < a > elements, < HTML > elements, at this point we just know < a > elements such as the statement that the above table is listed in all the things, that is, tags, attributes, element content, but if it is the & Lt A > tags like that, it really just means < a > this tag.
- An element typically includes tags, attributes, and element content, but there are also more specific elements, such as:< br >.
- Elements can be nested, one element can contain another element, such as the above example, < BODY > element contains < a > element, at this time < a > element is the < BODY > element content,< HTML and Gt element contains < BODY > and < a > elements, then both are elements of the < HTML > element.
Summarize:
- Note the distinction between < a > elements and < a > tags in both of these statements.
- With the < br > element as the representative of the special element, here is a related example.
- The content between the start tag and the end tag is the element content for that element, for example:< a > element content for click to jump to Baidu.
Examples related to < br >:
The result of the operation is:
This is a newline element.
This is a
Wrap element
We can see from the running results that the effect of the,< br > element is to wrap the text.
Generally written in < br/> when writing code.
We can see that the,< br > element is not an end tag, and we know that the element content of an element refers to the content between the start tag and the end tag, in other words < br > element is not element content, we also call such element as empty element.
Note that empty elements have no element content, but can have properties, such as:< img src= "picture. jpg" width= "height="/>.
end~HTML Elements of HTML notes