[問題] include 會自動換行

看板Web_Design作者 (酒池肉林夜夜生科)時間14年前 (2009/09/03 23:28), 編輯推噓1(105)
留言6則, 3人參與, 最新討論串1/1
我使用 css + php 我預計是讓 header 的東西能夠貼頂置中顯示在瀏覽器中 但是用 include 硬是會讓頂部留一行空 若是將 php 拆掉直接打進 header.html 的內容則不會有問題 總之所有的 include 都會莫名的留一行空 但內容是可以正常吃到 css 格式 (這裡就是顯現出藍色背景) 有沒有大大能幫忙除掉那行幽靈似的空白...>"< 感激不盡 ^^" 以下為網頁內容 <BODY topmargin="0" leftmargin="0"> <?php include("header.html"); ?> </BODY> 而 header.html 的內容是 <div class="top"> <div> <目前留空> </div> </div> 接著 .css 中則定義 .top { background-color: FFFFFF; width:100%; height:150px; position:relative; top:0px; margin:0 auto; text-align:center; } .top div { background-color: 0088FF; width:800px; height:100%; position:relative; top:0px; margin:0 auto; text-align:left; } -- 想你的時候 不一定能告訴你 如果不告訴你 也能會意 那我們就是有 真正的默契 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.115.48.90

09/03 23:29, , 1F
已爬文 include 換行 都沒找到相關解答 >"<
09/03 23:29, 1F

09/03 23:34, , 2F
檢視原始檔時也是正常的html格式 ~"~
09/03 23:34, 2F

09/03 23:58, , 3F
BOM ?
09/03 23:58, 3F

09/04 00:54, , 4F
八成是BOM
09/04 00:54, 4F

09/04 00:55, , 5F
google UTF-8 BOM
09/04 00:55, 5F

09/04 02:45, , 6F
喔喔喔 真的是因為BOM 另外推荐 Notepad++ 可以直接去掉
09/04 02:45, 6F
文章代碼(AID): #1Ad-2OUU (Web_Design)