When making web pages and programming, appropriate annotation will not only make your thinking clear and greatly reduce the difficulty of maintenance, but also facilitate other people in the project team to understand your code, facilitate understanding and modifying the code, etc. However, recently, when using div+css layout, you often encounter some unexpected troubles, and these troubles are caused by comments in the process of solving them.
Trouble 1: Text overflow caused by comments
Figure 1
This is a common problem. For example, in Figure 1 above, the two extra characters of the map are caused by comments, and they return to normal after removing comments.
Trouble 2: Floating misalignment caused by comments
As shown in Figure 2, the layout was originally planned to be like this. In order to see clearly, I added background colors to those two layers, but due to the addition of comments, the floating cannot be displayed as normal, but fell down. As shown in Figure 3, I thought it was the reason for the floating, and after careful inspection, I eliminated the floating and other reasons, deleted the comments and returned to normal.
Figure 2
Figure 3
These are the two problems caused by comments when I was working on templates. The easiest solution is to delete comments. However, since comments are often necessary, there is another way to solve them, which is not to place the comments between two floating layers. The specific method needs to be tried continuously.