我只想为 div 放置 100% 宽度的背景图像。你能帮我找出我的错误吗?
html
<div class="slogan_background">
<h2>Slogan</h2>
</div>
CSS
background-image: url("../img/bg.jpg");
background-repeat: no-repeat;
background-position: center;
width:100%;
min-height: 526px;
最佳答案
如果我对问题的理解正确,这可能会有所帮助:
background-size: cover;
关于css 为 100% 宽度的 div 放置背景图片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34209065/