事实上,我以为我已经尝试了所有的方法,但是当我再次尝试把代码放进去给你们看的时候,我似乎无意中发现了这个答案,这一次是可行的:
<div class="FrontPageBanner-1">
<h3>Lorem ipsum dolar sit amet</h3>
</br>
<span>Lorem ipsum dolar sit amet</span>
<img class="FrontPageBanner-1-Img-1" src="https://thailandpoolshop.com/wp-content/uploads/2018/07/S200_Banner_Robot.png">
<img class="FrontPageBanner-1-Img-2" src="https://thailandpoolshop.com/wp-content/uploads/2018/07/wave_banner_robot.png">
</div>
CSS:
.FrontPageBanner-1 {
width:100%;
position:relative;
background: linear-gradient(to right, #48e2ff, #396fcf);
border-radius:10px;
}
.FrontPageBanner-1-Img-1 {
position:absolute;
width:280px;
left:21px;
top:-70px;
z-index:1;
width:280px;
max-width:280px\9;
}
.FrontPageBanner-1-Img-2 {
position:absolute;
width:26%;
right:23px;
top:-47px;
z-index:1;
width:280px;
max-width:280px\9;
}
所以我想我将把它添加到我的CSS中,而不是将它放在我的代码中,以便于快速示例。我看到的唯一一个小问题是使用时
max-width:280\9;
图像仍然没有像主题那样快速收缩
@media (max-wdith:xxxx)
做。