We support Web Standards, and think that the Document Object Model (DOM, Document Object Model) proposed by it is very reasonable, useful, and necessary, representing a trend and progress. The Document Object Model disconnects us from characters and operates documents in an advanced way at the structure level.
In terms of Web page creation (HTML/XHTML), following Web Standards can make the website structure more reasonable. However, new standards will always lead to rejection by some old web page producers, which is very simple because they cannot grasp new standards or at the same time they think they do not need new standards, the original method is enough. I will not discuss it with those who reject and resist it.
When standards were applied, some web page makers had entered some misunderstandings. The structure of documents is often confusing for a standard that is not good at and is insignificant. This clearly violates the original intention of Web Standards. The original intention of Web Standards is to let us organize documents in a clear structure to facilitate the use of DOM to operate documents.
For example, the layout of three columns (usually three div labels) during the webpage creation process. Many web page creators use the nesting of three div labels to achieve the goal, because if not nested, when the window is reduced, the div label will flow down.
They are like this:
The code is as follows: |
Copy code |
<Div id = "column1"> <Div id = "column2"> <Div id = "column3"> </Div> </Div> </Div>
|
In terms of structure, content, and performance, these three columns are usually of equal status and should not be nested. Nesting implies their affiliated relationships. When we use xml parsing tools such as JDOM, DOM4j, or DOM JavaScript (ECMAScript) binding to parse these contents, we will encounter logical confusion.
Those who are biased against Web Standards may say that using table layout can easily achieve a good three-column layout. Let's look at the table code:
The code is as follows: |
Copy code |
<Table> <Tr> <Td id = "column1"> </td> <Td id = "column2"> </td> <Td id = "column3"> </td> </Tr> </Table>
|