【发布时间】:2014-11-03 07:23:14
【问题描述】:
这是How to create a custom list style with a dash的后续行动。
具体来说,我的问题涉及 Internet Explorer 9。 (请参阅本问题末尾的示例 XHTML 文档。我的示例文档包含内联 CSS。)
当我以本地文件的形式查看我的示例 XHTML 文档时,我在 IE9 中看到了预期的结果:
Here is a list:
- One
- Two
- Three
然而,当我通过 IIS 查看同一个 XHTML 文档时,我在 IE9 中看到了一些不同:
Here is a list:
One
Two
Three
也就是说,IE9 不呈现破折号,它打算出现在每个列表项的开头。
(请注意,Firefox 31 会在本地以及通过 IIS 查看文件时呈现破折号。)
这个问题是否与 IIS 返回的 HTTP 标头有关?以下是我的 IIS 实例返回的关键标头:
200 OK
Date: Tue, 09 Sep 2014 18:41:34 GMT
Server: Microsoft-IIS/7.5
Content-Length: 706
Content-Type: text/html
Title: Custom List Item Test
X-Powered-By: ASP.NET
XHTML 文档示例:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Custom List Item Test</title>
<!-- https://stackoverflow.com/a/24279072/1497596 -->
<style type="text/css">
ul
{
list-style-type: none;
}
ul > li:before
{
content: "-";
position: absolute;
margin-left: -1.1em;
}
</style>
</head>
<body>
<h1>Here is a list:</h1>
<ul>
<li>One</li>
<li>Two</li>
<li>Three</li>
</ul>
</body>
</html>
【问题讨论】:
-
IE 不能对本地和远程内容做出不同的响应吗?我似乎记得您可以告诉 IE 对所有本地内容或类似内容使用兼容模式模式。检查设置。和/或如果您在 http 中放置一个明确的 x-ua-compatible 标头(或作为源中的 http-equiv)会发生什么?
标签: css internet-explorer iis xhtml html-lists