Home  >  Article  >  Backend Development  >  php引入css文件出错,但是网页已经有样式了

php引入css文件出错,但是网页已经有样式了

WBOY
WBOYOriginal
2016-06-20 12:26:171266browse

求助:php引入css文件出错,但是网页已经有样式了,错误代码如下


回复讨论(解决方案)

代码如下:php代码
nbsp;html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">



<!-- {Webname} -->



top

header

nav

search

user

news

pic

rec

sidebar-right

picnews

newslist

link

footer


网页已经有CSS的样式了,但是报ERROR,以下为css代码:
@CHARSET "UTF-8";
body,h1,h2,h3,p,form,ul,li,dl,dt,dd {
padding:0;
margin:0;
}
body {
width:960px;
margin:0 auto;
background:#fff;
}
#top {
height:26px;
background:red;
margin:0 0 10px 0;
}
#header {
height:80px;
background:green;
margin:0 0 10px 0;
}
#nav {
height:35px;
background:navy;
}
#search {
height:35px;
background:maroon;
margin:0 0 10px 0;
}
#user {
width:270px;
height:400px;
background:orange;
float:right;
margin:0 0 10px 0;
}
#news {
width:400px;
height:400px;
background:blue;
float:right;
margin:0 10px 10px 0;
}
#pic {
width:270px;
height:195px;
background:green;
float:left;
margin:0 0 10px 0;
}
#rec {
width:270px;
height:195px;
background:red;
float:left;
margin:0 0 10px 0;
}
#sidebar-right {
width:270px;
height:835px;
background:red;
float:right;
margin:0 0 10px 0;
}
#picnews {
width:680px;
height:200px;
background:yellow;
float:left;
margin:0 0 10px 0;
}
#newslist {
width:680px;
height:625px;
background:pink;
float:left;
margin:0 0 10px 0;
}
#link {
width:960px;
height:110px;
background:orange;
float:left;
margin:0 0 10px 0;
}
#footer {
width:960px;
height:40px;
background:blue;
float:left;
}

一个中文都没有,却还要声明为 utf-8
BOM 头在 utf-8 声明之前,出点错也是正常的

一个中文都没有,却还要声明为 utf-8
BOM 头在 utf-8 声明之前,出点错也是正常的




大神,,我确实把 charset=utf-8" 去除了,就没有错误了,但是您说的BOM头问题,我的是无BOM头UTF8编码啊。。。。。
Statement:
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