[英]div background color not covering full height and width of background image div
我在填充背景色时遇到问题。 默认的div
包含一个图像,当我单击下一步按钮时,它会激活另一个具有background-color
和一些文本的div
,但是仍然可以在div
的角落看到我的图像部分。
HTML:
<div class="survey_box-active">
<img src="" />
</div>
<div class="survey_box">
<h2>Headline</h2>
<p>some text</>
</div>
CSS:
survey_box,
survey_box-active {
display: none;
overflow: hidden;
img {
display: block;
}
}
survey_box-active {
display: block;
}
[class*=survey_box] {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #f3f3f3;
}
尝试更改img标签的css。
img {
display: block;
max-width:100%;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.