I have been exposed to web standards for a long time, but it has not been long since I started practicing them. Today I would like to share some insights about code structure with newbies like wolves. This article is an introductory reading.
Some friends may feel a little confused after seeing this title, so let Wolf explain it to everyone.
First of all, let’s talk about Wolf’s understanding of the part of speech of “DIV CSS”. Wolf thinks it is an adjective. She described adopting a web design technology that uses DIV (actually XHTML) as the structure and CSS as the presentation. When web standards were introduced to China, many people described the use of web standard design as "DIV CSS" to make it easier for everyone to understand! However, problems also emerged. Many designers who are new to web standards simply think that they should use DIV to replace our original table layout. The structure of the web pages they designed also includes DIV and CSS.
The error that occurs is as shown in the figure. All elements adopt DIV layout.
A simple analysis of the error. Due to wrong understanding, many novices will completely use DIV for layout. In such a structure, DIV2 and 3 have no semantics at all. One of the reasons we adopt web standards is to make the structure of the code more meaningful. I remember thinking that the experts said that using DIV indiscriminately is as bad as using table layout.
In fact, we can modify the code like this. Let’s make our web page structure better.
Here, DIV2 and 3 are replaced with h2 and p that are more consistent with the content of the page. Make the code structure of the page clearer and more meaningful.
I believe everyone should understand the meaning of "DIV CSS is not really DIV CSS" through Wolf's example.