Home >Web Front-end >HTML Tutorial >Return the html tag to its original meaning_html/css_WEB-ITnose
To be honest, the term "div css" has harmed many people. Maybe the original intention of the person who proposed it is not wrong, but the followers misinterpreted its meaning and thought that the entire page should be It is a combination of div css files. Doing this has no visual impact, because it restores the previously designed page renderings, but if this HTML document is handed over to a machine (such as a spider) for analysis, it may not be able to find the key points at all, and your entire page will be focused on it. For example, it is like a termite nest. The first thing it needs to do is to remove the same things and then filter the content.
The development of search engines has given birth to a profession "seo" in the Internet industry. Because they have to do "keywords", almost all "seo" put their "technical core" on researching keywords. In addition to making the title, keywords, description and entire document full of keywords that may be of interest to search engines. Even the alt attribute of the image and the title attribute of the text container are "keywords". Such seemingly perfect "seo technology" often ignores two important points: 1. The definition of html tags. 2. Streamline the page. The former allows search engines to have an "understanding" of the "meaning" throughout the page, while the latter improves access speed and reduces server load. It’s a pity that “seo” people often don’t understand HTML and load, and people who write code often don’t understand “seo technology”. This may cause a considerable career bottleneck, and the mentality of eager for quick success and quick profit makes these two professions They don’t learn from each other and each does his own thing.
In my development experience, I have encountered html tags that are all divs. It seems that except for the
and , the rest are allThere are more than 50 kinds of html tags, see Chapter 4 for details. Our commonly used html tags (except form tags) mainly include the following:
div, ul, ol, li, dl, dt,dd,p,span,h1-h6,label,em,strong,img,a,u,b,i,s...
I think it is necessary to give their definitions and give them later They are divided into groups. The w3c grouping is more scientific than me, but not as easy to understand as me:
div: division (separate, split, distinguish, allocate, dividing line), tags can divide the document into independent, different parts. As a representative of block-level elements, because there is no fixed format, it is currently the most abused.
ul:unordered list (unordered list) is combined with the li element to form a group.
ol:ordered list (ordered list) is combined with the li element to form a group.
li:list item (list item) must be within the parent ul or ol container. This must be added by myself. w3c just said this:
contexts in which this element can be used: inside elements. inside elements. inside elements.
I added a must in front of it to express the seriousness of this problem ^^
dl:definition list (definition list) is combined into a group with dt (items defined by definition term) and dd (description defined by definition description).
p:paragraph (paragraph) is used to store a paragraph of the article.
span: The span (range) tag is used to combine the content of sections in the document. As an inline element, and because it does not have a fixed format, it is currently abused more.
h1-h6: head (title 1 to title 6), please note that the head here represents its meaning, which is different from the
tag, and do not think it has anything to do withNote that if the search engine finds that there is an h tag in the page, it will consider the content in it to be more important, and the importance will gradually decrease from 1 to 6.
label:label (label for form controls), its name is label, but here, the definition given by w3c is that it is used as a description of the form, for example, we like to put it before or after the input label Add it.
em: emphasized (emphasis, emphasis), to emphasize the text it contains. The default style is italic. The display effect is similar to the tag, but search engines do not think they are the same, because search engines tend to respect the definition given by w3c and ignore your display effect.
strong:strong (emphasis, emphasis), to emphasize the text it contains. The default style is bold. Its emphasis effect is a little stronger than em. Although the tag can also have a bold display effect, search engines do not consider them to be the same for the same reason.
img:image (picture, image);
a:anchor (anchor) creates the basic chain in a hyperlink.
u: underline (text underline), will be eliminated soon.
s/strike: strikethrough, draw a line across the text.
According to display style:
Block-level elements or block elements, (default style is block) tags:
div,ul,ol,li,p ,dl,dt,dd, h1-h6...
They will occupy one line by default. Unless you change them with styles.
Inline elements, (the default style is inline, but I think it is easier to understand called "inline elements") labels are:
span, label, em, strong, img, a,u,b,i,s...
By default, they will coexist in a row with other elements. When you add some specific styles to them, for example: display:block , they will also dominate a row. But what should be mentioned in advance here is that not all display:blocks must occupy one line. If there is width, and float is used as a pusher to push them forward, they will be squeezed into one line with other elements.
According to combination:
Fixed groups:
ul--li
ol--li
dl-- dt--dd
Scattered individuals:
Others...
Some explanations are needed:
1. Inline elements, they They are not "framed", that is, their size is controlled by their content. Before it becomes a block-level element, it is useless for you to control its width and height. Ways to become a block-level element: 1. display:block (directly occupying the entire row) 2. float will not occupy the entire row, but you can control its width or height.
2. Some elements that cannot be included or nested (copied from w3c):
a: cannot contain other a tags.
must not contain other a element.
pre: (preformatted predefined format (text)) cannot contain img, object, big, small, sub, or sup elements
must not contain the img, object, big, small, sub, or sup elements.
button button, cannot contain input, select, textarea, label, button, form, fieldset, iframe or isindex elements.
must not contain the input, select, textarea, label, button, form, fieldset, iframe or isindex elements.
label must not contain other label elements
must not contain other label elements.
form must not contain other form elements.