We all know that an important component of a building is the establishment of its foundation, and without a solid and good foundation. The gorgeous appearance and decoration no longer exist. We build web pages that comply with Web tags, and most people are more concerned about CSS technology and its applications. But we also need to understand that no matter how powerful CSS is, it also affects XHTML. Without a well-structured XHTML foundation, our layout will be more difficult to implement. Perhaps our foundation is very solid, but the complicated details and unreasonable structure will also become obstacles to our development.
In the early days of the Web, HTML was only used to add basic form and structure. With the development of the Internet, HTML is used to represent pages. We use various combinations to achieve the look we want. We are used to using the B tag to bold the title of the document, but we do not use the title h1~h6 to display them. What's more important is that we run tables for layout. In the early days, tables were only used to display table data, not for layout and layout display. With the development of WEB, we soon found that everything was lost. original meaning. Font design, tables, bolding, etc. have become a mess. becomes incomprehensible. And it's getting more and more complex.
We are increasingly inclined to rely on WYSIWYG tools such as Dreamweaver to process web pages, but unfortunately, such software does not improve this chaotic situation, but instead adds more complex markup of their own. . In this case, we can no longer edit the code by hand, and everything looks really bad.
With the emergence of CSS, we have seen the dawn of hope in building web pages that comply with Web standards. People are paying more and more attention to website reconstruction to separate performance from content. A new era has begun. We can remove some meaningless tags, such as: font, b, i, etc. We leave these tasks to CSS. We can use CSS for layout instead of using tables to build pages.
We can create documents according to the meaning of the tag itself, and we can redefine their appearance through CSS using the browser's default style. Titles, paragraphs or lists in content, we can reset them through CSS. Titles don’t have to be large, bold and ugly. Paragraphs can control their line spacing and indentation. Lists don’t have to be vertical, we can also arrange them horizontally. etc.
The benefit of meaningful tags makes it easier for us to understand the content of the code and process them. For example, if we need to modify all external links on the page, if we add appropriate tags to these elements, we can easily find them and modify them. If everything is mixed together, we have no where to start.
In addition to making our development easier, other devices and programs can also have a better understanding of documents. The most typical one is the recognition of search engines. Search engines can easily find the titles and subtitles in articles. Article content. If the viewer is using a handheld reading device, you can rely on the title, content, etc. to give good navigation and display proportions.
The most important thing is that meaningful HTML tags will provide an easy way to adjust elements to the style you want. These meaningful tags create a basic structural framework model in the document, and we do not have to add other elements. The id or class and other identifiers can directly control the performance.
These meaningful tags mainly include:
h1, h2...h6;
ul,ol,dl;
strong, em;
blockquote,cite;
abbr, acronym, code;
fieldset, legend, label;
caption, thead, tbody, tfoot, etc.
In CSS page layout, when you can use them, don't use other things. Try to use meaningful html tags.