0

不完全确定发生了什么,但我从 Internet Explorer 和 Google Chrome 收到以下错误......但它在 Opera 中完美显示>_>

谷歌

此 XML 文件似乎没有任何与之关联的样式信息。文档树如下所示。

IE

IE 呈现页面,但不应用任何标签,只显示文本 >_>

代码

XHTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" 
   "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<!-- This is a redesign of my redesign -->
<html>
    <head>
         <title>Hello</title>
         <link rel="stylesheet" type="text/css" href="css/fonts.css" />
         <link rel="stylesheet" type="text/css" href="css/main.css" />
         <link rel="stylesheet" type="text/css" href="css/container.css"/>
         <link rel="stylesheet" type="text/css" href="css/banner.css" />
    </head>
    <body>
        <div id="Container">
            <div id="Banner"></div>
            <div id="Content"><p>Hello World</p></div>
        </div>
    </body>
</html>

CSS 示例

@charset “UTF-8?";
/*CSS for the Container and non div items*/
#Container {
    width: 80%;
    min-height: 600px;
    max-height: 1200px;
    margin: 0 auto;
    margin-top: 1%;
    z-index: 0;
}
#Content {
    position: relative;
    width: 100%;        
    min-height: 70%;
    height: 80%;
    max-height: 80%;
    background-color: red;
    z-index: 2;
    border-style: solid;
    border-left-width: 1px;
    border-right-width: 1px;
    border-color: black;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

是什么给了 O_o

4

2 回答 2

2

XHTML 文件必须在其 html 开始标记中具有 xmlns 属性xmlns="http://www.w3.org/1999/xhtml",否则将不会被识别为 XHTML。

Opera 的行为是非标准的。

于 2012-02-17T12:24:36.947 回答
0

您的 CSS 文件中的第一行看起来是错误的:

@charset “UTF-8?;

应该是:

@charset "UTF-8";
于 2012-02-17T12:03:39.860 回答