Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem that the content of php page is not centered

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article will explain in detail how to solve the problem that the content of the php page is not centered. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

Php page content is not centered solution: 1, put the include file in the head; 2, save the PHP file with UTF-8 encoding and cancel the Unicode signature.

This article operating environment: windows7 system, PHP7.1 version, DELL G3 computer

How to solve the problem that the content of the php page is not centered?

After PHP- introduces the file (include), the page is misplaced and the solution is not centered.

1, put the include file in the head, not on the html or doctype, this can solve the center problem, blank lines can be used to include the include file, but this is not the fundamental solution.

2. The fundamental solution is to open the include file with DW, modify the toolbar-> Page Properties-> title Encoding-> include the Unicode signature (BOM) and remove the check box.

In this case, no matter where it is included, there will be no such problem. Of course, you can also use other editors to remove it.

Find the reason:

Analyze the reasons:

When a file is saved in UTF-8 encoding, there are two situations: with Unicode signature (BOM) and without Unicode signature. BOM information is a string of hidden characters at the beginning of a file that some editors recognize as a UTF-8-encoded file.

But for PHP, PHP did not consider the problem of BOM in the design, will not ignore the three characters of the BOM at the beginning of the UTF-8-encoded file, and will take BOM as part of the body at the beginning of the file. Because it has to be in

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report