[英]Repeat-y is not working for me. The image is not repeating as it should
我在下面有一個簡單的 html 代碼
<body>
<div class="wrapper">
<div class="container">
<div class="sky"></div>
<img src="images/arcade-game.png" alt="">
</div>
</div>
</body>
這是我的 CSS 代碼
.container{
height:90vh;
width:90vw;
background-color: white;
margin: auto auto;
position: relative;
overflow:hidden;
}
.sky{
height: 100%;
width: 100%;
background-image: url(/images/sky.jpg);
background-size: cover;
background-repeat: repeat-y;
animation: movingsky 4s linear infinite;
}
我有 animation 讓.sky
向下移動,但是背景沒有像我想要的那樣重復。
我在這里遺漏了什么嗎?
background-size: cover;
將拉伸圖像以填充整個容器,因此看不到重復。 刪除background-size
或將其設置為固定大小。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.