简体   繁体   English

如何从 SSI 包含文件中删除空格?

[英]How to Remove white spaces from SSI include file?

I am working with Server Side Includes in WAMP on Windows.我正在使用 Windows 上的 WAMP 中的服务器端包含。 My html files are executing with SSI file includes but it is displaying the blank white spaces in the output.我的 html 文件正在执行包含 SSI 文件的文件,但它在 output 中显示空白空格。

How can i remove the white spaces generated by如何删除由

<!--include file="header.html" --> 

tag.标签。 this is generating white spaces which is crashing my page design.这会产生空白,这会破坏我的页面设计。

Please help.请帮忙。 Thanks谢谢

So I ended up finding a solution that worked for me:所以我最终找到了一个适合我的解决方案:

UTF8 makes an extra line on my site UTF8 在我的网站上增加了一行

Save all your files as UTF-8 without BOM ( http://en.wikipedia.org/wiki/Byte_order_mark ).将所有文件另存为 UTF-8 没有 BOM ( http://en.wikipedia.org/wiki/Byte_order_mark )。

Try removing all white spaces in your directives.尝试删除指令中的所有空格。

ie, IE,

<!--#include virtual="xxx.shtml"--><header>title</header>
<p>lorem ipsum, bacon, and stuffs...</p>
<footer>copyright</footer><!--#include virtual="xxx.shtml"-->

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM