html - IE8 在 IIS 上不显示背景图像

标签 html css iis

我有以下代码:

<!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" dir="ltr" lang="en-US" class="js">
<head profile="http://gmpg.org/xfn/11">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>| TheProfessional Theme</title>
    <style type="text/css">
        .et-custom-list ul
        {
            list-style: none !important;
            list-style-image: none !important;
            padding-left: 0 !important;
            margin: 0 !important;
            line-height: 26px;
        }
        .et-custom-list ul li
        {
            padding-left: 28px !important;
            margin: 5px 0 !important;
            list-style: none !important;
            position: relative;
        }
        .et-custom-list ul li:before
        {
            content: '';
            position: absolute;
            top: 5px;
            left: 0;
            background: url(https://www.elegantthemes.com/preview/TheProfessional/wp-content/themes/TheProfessional/epanel/shortcodes/images/shortcodes-sprite.png) no-repeat -74px -2px;
            width: 22px;
            height: 18px;
        }
    </style>
</head>
<body>
    <div class="et-custom-list">
        <ul>
            <li>list item 1</li>
            <li>list item 2
                <ul>
                    <li>list item 1</li>
                    <li>list item 2</li>
                </ul>
            </li>
            <li>list item 3</li>
            <li>list item 4</li>
        </ul>
    </div>
</body>
</html>

当在我的桌面上保存为 HTML 文件时,它适用于所有浏览器。当我将文件移动到服务器 (IIS) 时,它适用于除 II8 以外的所有浏览器。是否有任何原因导致它在 IIS 上的 IE8 中突然停止工作?

现在一位同事告诉我它在桌面上的 IE7 中也不起作用

最佳答案

用双引号 (") 包裹您的背景网址:

background: url("https://www.elegantthemes.com/preview/TheProfessional/wp-content/themes/TheProfessional/epanel/shortcodes/images/shortcodes-sprite.png") no-repeat -74px -2px;

关于html - IE8 在 IIS 上不显示背景图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15475835/

相关文章:

javascript - 按下按钮时,如何使此交通灯序列重复多次>

c# - 在 WCF 中返回错误的适当方式

iis - Umbraco 6 部署到生产环境,页面呈现空白

javascript - d3.js 条形图不太像我想要的

html - Bootstrap - 页脚有两个 div,希望它们堆叠

javascript - 在另一个 div 上方的层(z-index)中找到 div

CSS flexbox 布局在 safari 中不起作用

html - 我的文本框中的文本与左中心对齐。我该如何删除它?

powershell - 使用 PowerShell 配置 IIS 应用程序池设置

php - SSL 仅适用于网站的一半