The same code, why the browser press F12 after seeing the code there is so gap

Source: Internet
Author: User
Source:
 
  Untitled Document


Very clean code.

Write directly in PHP chrome F12 in elements



This is the case, after some code, the direct output of the above HTML code, it becomes this.


This is the effect of writing HTML code directly into a PHP file. Why there is such a big difference.


Reply to discussion (solution)

You use the OB function to intercept the PHP output and save it to a file
Then compare the differences between the files
If there is no difference, it is the browser problem, you can do nothing
If there are differences, analyze the reasons for the differences.

The middle of the graph, the code. Strictly speaking, also is not standard. However, the browser may have error correction function, so the effect may be the same.

The middle of the graph, the code. Strictly speaking, also is not standard. However, the browser may have error correction function, so the effect may be the same.



The first source code is a new file created directly with DW! No changes have been made.
I used a Chrome browser, and FF tried. See the source code to see the same.
Using F12 development tools in elements
The first picture body below has two quotation marks, do not know how to come out

The second picture looks the same as the source code.

It's depressing!

The head content appears in the body where your HTML page is not a UTF8 file with DOM headers, you turn this page into a DOM-free test with the editor

It's the DOM header file that was edited with Notepad and the intermediate transcoding.
It is recommended to build a blank file in the Ue,ediplus,phpstorm, and then copy the contents of the existing file to the past, you can.

It's the DOM header file that was edited with Notepad and the intermediate transcoding.
It is recommended to build a blank file in the Ue,ediplus,phpstorm, and then copy the contents of the existing file to the past, you can.



Correct the BOM, not the DOM.

The head content appears in the body where your HTML page is not a UTF8 file with DOM headers, you turn this page into a DOM-free test with the editor


More than the BOM, not the DOM.

Anyway, you two helped me find the problem!! The original has been using EditPlus edit PHP, recently see notepad++ quite fresh to use, come out such a problem!! It's called a hurry!!! I have been tossing for several days also can not find out why!!!
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.