gpt4 book ai didi

css - IE8 不加载背景图片

转载 作者:太空宇宙 更新时间:2023-11-03 23:34:43 25 4
gpt4 key购买 nike

IE8 不会在 div 上显示背景图片。

我的 HTML:

<section class="section-divider textdivider divider1">
<div class="container">
<h1>Info About The Foundation</h1>
<hr>
<p>Microfestival stable energy fields natural homebirth sarong watsu, aura discovering valuable truths. Nature equinox forest, feline acupuncture salvia. Didgeridoo prius what the planet really needs, divine feminine compostable toilet change agent closing circle feeling deep gratitude sustainable rain dance prayerformance. Beltane perineum cuddle party, bioneers radiant.</p>
<a href="about.html" class="btn btn-success">More About The Foundation</a>
</div>
</section>

我的 CSS:

.divider1 {
background-image: url('../images/bg/divider1.jpg')
}

在 IE8 中甚至无法加载图像。它只显示文本,根本不使用任何样式。是因为 IE8 无法读取 div 的图像吗?我环顾四周,没有看到任何迹象表明 IE8 无法做到这一点。

最佳答案

记住,<section>是一个新的 HTML5 元素,意味着 IE8 不会自动识别它。您是否 A) 添加了 html5shiv 和 B) 在 CSS 中设置了显示属性?

HTML5Shiv

<!--[if lt IE 9]>
<script>document.createElement("section");</script>
<![endif]-->

CSS

section { display:block; }

90% 的时间,我的新元素无法在 IE8 上运行的原因是因为我忘记添加这两个。

关于css - IE8 不加载背景图片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24438993/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com