Home Backend Development PHP Tutorial 页面最顶部使用include后,会显示空白行,css也不正常,求解决办法

页面最顶部使用include后,会显示空白行,css也不正常,求解决办法

Jun 13, 2016 am 11:59 AM
bom dreamweaver nbsp xhtml

页面最顶部使用include后,会显示空白行,css也不正常,求解决方法
页面是utf-8编码
编辑器:dreamweaver 页面属性已经勾选了 包括Unicode签名(BOM)(s)
这样页面顶部会显示一行空白,查看源代码什么都正常:

<?php include_once("inc.php");?><br /><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br /><html xmlns="http://www.w3.org/1999/xhtml"><br /><head>
Copy after login


------解决方案--------------------
确定不是代码产生的对吧? 如果确定不是代码产生的话,换个编辑器用utf-8无bom头编码保存一下。
------解决方案--------------------
文件编码如果是utf-8,头部会占用3个字符,文件改成无bom看看。
------解决方案--------------------
“dreamweaver 页面属性已经勾选了 包括Unicode签名(BOM)(s)”

在DW中,按CTRL+J,编码,然后不要勾选此项,PHP本身是无法识别BOM头信息的,所以会出现COOKIE、SESSION、空白异常等状况

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Two Point Museum: All Exhibits And Where To Find Them
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to adjust text position in dreamweaver How to adjust text position in dreamweaver Apr 09, 2024 am 02:24 AM

Adjusting the text position in Dreamweaver can be completed by the following steps: Select the text and use the text position adjuster to make horizontal adjustments: left alignment, right alignment, center alignment; 2. Make vertical adjustments: top alignment, bottom alignment, vertical center; 3. Press Shift key and use the arrow keys to fine-tune the position; 4. Use shortcut keys to quickly align: left alignment (Ctrl/Cmd + L), right alignment (Ctrl/Cmd + R), center alignment (Ctrl/Cmd + C).

How to add video to dreamweaver webpage production How to add video to dreamweaver webpage production Apr 09, 2024 am 01:42 AM

Embed video using Dreamweaver: Insert a video element. Select and upload a video file. Set video type, URL, size, autoplay and controls. Insert video. Optional: Customize the video appearance.

How to adjust line spacing in dreamweaver How to adjust line spacing in dreamweaver Apr 09, 2024 am 03:00 AM

Adjusting line spacing in Dreamweaver is a four-step process: select the text, open the Paragraph panel, adjust the Line Spacing options, and finally click OK to apply the changes.

How to set text size in dreamweaver How to set text size in dreamweaver Apr 09, 2024 am 02:18 AM

To set text size in Dreamweaver, just: Select the text Go to the Text menu Select Font Size Select the desired size Press Enter to save

How to indent text in dreamweaver How to indent text in dreamweaver Apr 09, 2024 am 02:15 AM

There are four ways to indent text in Dreamweaver: Indent a single paragraph: Format > Paragraph > Indent Indent multiple paragraphs: Set the indent value in the paragraph panel Use style: Set the indent value in the paragraph style dialog box Use indent Key: Tab key to indent right, Shift + Tab key to indent left

How to add pictures to dreamweaver How to add pictures to dreamweaver Apr 09, 2024 am 03:30 AM

To insert a picture in Dreamweaver, click the Insert menu and choose Image, then navigate to the picture file and select it. Other methods include dragging and dropping files or inserting HTML code directly. Adjusting properties includes changing size, alignment, adding borders, and entering alt text.

How to set the web design software Dreamweaver to Chinese How to set the web design software Dreamweaver to Chinese Apr 09, 2024 am 12:39 AM

To set Dreamweaver to Chinese, follow these steps: Open Dreamweaver; change User Interface Language to Simplified Chinese or Traditional Chinese in the preferences; restart Dreamweaver; check the Help menu About Dreamweaver" item to verify the language settings.

How to set dreamweaver font How to set dreamweaver font Apr 09, 2024 am 02:54 AM

You can set fonts in Dreamweaver by selecting a font, size, and color using the Properties panel. Use CSS to set fonts for your entire website or specific elements. Set the font directly in the HTML code using the "font" tag.

See all articles