XHTML:CSS 不显示?
不完全确定发生了什么,但我从 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 的作用是什么
Not sure entirely what is happening, but I get the following errors from Internet Explorer and Google Chrome...yet it displays perfectly in Opera >_>
This XML file does not appear to have any style information associated
with it. The document tree is shown below.
IE
IE renders the page but doesn't apply ANY of the tags and just displays the text >_>
Code
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 Example
@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;
}
What gives O_o
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
XHTML 文件必须在其 html 开始标记中具有 xmlns 属性
xmlns="http://www.w3.org/1999/xhtml"
,否则将无法识别作为 XHTML。Opera 的行为是不标准的。
An XHTML file MUST have the xmlns attribute
xmlns="http://www.w3.org/1999/xhtml"
in its html start tag or it will not be recognised as XHTML.Opera's behaviour is non-standard.
CSS 文件中的第一行看起来错误:
可能应该是:
The first line in your CSS file looks wrong:
Should probably be: