一次无意中查看网志博客网页源码,发现源码的顶头空了7行,如图:
这怎么回事?
我检查了一下模板,顶头并没发现什么空行。于是打开控制器,发现了问题,如图:
代码有空行!
去掉“”前后的空行,再查看网页源码,空行少了几行,可是还有两三行空白。打开项目模型类,再一次去掉“”前后的空行。再一次打开网页源码,发现顶头空行彻底消除!
小结:
前一次也由于类似的问题导致验证码无法正常显示,以致我折腾了好几天,我在“ThinkPHP验证码问题解决方法汇总”提到过,没想到代码空行还会导致网页源码头的空行,看来代码空行出现的问题还真多,不知以后还会惹出来什么麻烦。当然上面的问题暂时是解决了,但那是治标不治本的办法,治本的方法是:养成良好规范的编码习惯。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Chinese version
Chinese version, very easy to use

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Linux new version
SublimeText3 Linux latest version

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.
