UTF-8 the effect of no BOM coding on SSI

Source: Internet
Author: User

Recently when loading submodules with SSI (Server Side includes), I found a strange phenomenon, the Web page after loading is always a problem with CSS, the loading module is always empty after rendering. A simple example is given below.

The contents of the file a.html are as follows:

1 <!DOCTYPE HTML>2 <HTML>3     <Head>4         <style>5             *{6 margin:0;7 padding:0;8             }9 #ah{Ten Border:Solid 2px Red; One             } A #bh{ - Border:Solid 2px Black; -             } the         </style> -     </Head> -     <Body> -         <H1ID= "Ah">AH</H1> +         <!--#include file= "b.html" - -     </Body> + </HTML>

The included file b.html content is as follows:

1 <H1 id= "BH">bh</H1 >

Finally published on IIS, the results are as follows:

Ah and BH in the middle of a blank line, baffled the solution, and even began to doubt their own CSS level, but also began to doubt their own life ...

Finally opened with notepad++, looked under the code, shocked:

Instant comprehension, save it as a UTF-8 format without BOM, the effect of accessing the page again is as follows:

Finally show normal, the evil of the BOM (Byte Order Mark), the evil of the Notepad, but also in Notepad to write the program's experts, change a text editor:)

UTF-8 the effect of no BOM coding on SSI

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.