我的图片没有显示到 div 的背景中。
.page-header {
background-image: url("../images/page-header-img.png");
background-repeat:no-repeat;
background-size:cover;
background-position:center;
width:100% ;
height:250px;
display:block;
justify-content: center;
grid-column: 1 / span 12;
margin-bottom:1rem;
background-position: top;
}
<div class="page-header">
<h1><?php the_title();?></h1>
</div>
最佳答案
.page-header {
background-image: url("./../../images/page-header-img.png");
background-repeat:no-repeat;
background-size:cover;
background-position:center;
width:100% ;
height:250px;
display:block;
justify-content: center;
grid-column: 1 / span 12;
margin-bottom:1rem;
background-position: top;
}
关于html - 如何让我的图像在 CSS 中显示出来?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58912402/