There is a blank section at the top of the html page. Check the console and find the & #65279 characters in the body. The cause and solution are as follows,
There is a blank section at the top of the html page. Check the console and find the & #65279 characters in the body. The cause and solution are as follows:
Analysis:
It turns out that BOM was added during page encoding. The back-end data of this page is mainly in the PHP language. For PHP, BOM is not taken into account during design ,, does not ignore the three characters at the beginning of the BOM for a UTF-8-encoded file, and uses the BOM as part of the body at the beginning of the file. Because it must be in the <? Or <? The code after php is executed as PHP code, so the three characters will be output on the page. The display effect depends on the browser, which is generally a blank line or garbled code. Because these three characters exist at the beginning of html, even if the top padding of the page is set to 0, the whole web page cannot be placed close to the top of the browser. Due to the restriction of the COOKIE sending mechanism, the COOKIE cannot be sent to files whose names start with BOM (because PHP has already sent the file header before the COOKIE is sent ), therefore, the logon and logout functions are invalid. All functions dependent on cookies and sessions are invalid.
Solution:
When editing or changing any text files, you must use an editor without adding BOM. The editor in linux should have no such problem. In WINDOWS, do not use notepad or other editors.
The recommended editor is:
1. UltraEdit (you need to cancel the related options of 'add BOM );
2. Dreamweaver (you need to cancel the related options of 'add BOM)I used this to solve the problem.;
3, Notepad (need to be "converted to a UTF-8 without BOM") and so on;
4. For files that have added BOM, to cancel, you can save it again with the above Editor (Editplus needs to be saved as gb first, then saved as UTF-8 .).