【发布时间】:2023-10-13 03:13:01
【问题描述】:
我遇到了一个问题,即背景图像没有显示在 chrome 和 firefox 上;它是全宽 div 的背景图像。任何帮助表示赞赏:) 请在下面查看我的代码:
#judges {
width: 960px;
margin: 0 auto;
padding-top: 80px;
}
#judges .col1 p, #judges .col2 p {
font-family: 'SohoGothicPro-regular', verdana, sans-serif;
text-align: center;
}
#judges .col1 p, #judges .col2 p, #judges .col1 h3, #judges .col1 h3 {
color: white;
}
#judges_bg {
clear: both;
background-image: url('img/faces.png');
position: absolute;
width: 100vw;
left: calc(-50vw + 50%);
height: 380px;
overflow: hidden;
}
#judges .readmore a {
color: white;
}
<div id="judges_bg" class="grey_overley">
<div id="judges"><!-- JUDGES START -->
<div class="col1" style="color: white; text-shadow: 0 0 70px rgba(1,2,2,.99); font-family: 'SohoGothicPro-bold', verdana, sans-serif;">
<div class="wow slideInLeft" data-wow-duration="2s" data-wow-offset="100"><p>The distinguished, international panel of judges is comprised of engineers and scientists representing the diversity of the profession. Lord Alec Broers is Chairman of the 2015 Judging Panel.</p></div>
</div>
<div class="col2">
<div class="wow slideInRight" data-wow-duration="2s" data-wow-offset="100">
<h3 style="color: white; text-shadow: 0 0 70px rgba(1,2,2,.99);">Who are the<br> <span>Judges?</span></h3></div>
</div>
</div><!-- JUDGES END -->
<div class="read_more"><a href="#" style="color: white;">Meet the Judges</a></div>
</div>
【问题讨论】:
-
你能看到是否设置了高度吗?如果不尝试明确设置高度。
-
我签入萤火虫时没有设置高度
标签: css background-image