0
我試圖做一個相當簡單的網頁,有一個橫幅圖像 和簡單的動畫(字幕仿真)。我想在頁面中的響應圖像 。問題是,每當動畫循環迭代,圖像大小調整重演。圖像的大小調整不斷重演
.marquee {
overflow: hidden;
white-space: nowrap;
animation: marquee 17s linear infinite;
-webkit-animation: marquee 17s linear infinite;
background-color: red;
}
.marquee:hover {
-webkit-animation-play-state: paused;
animation-play-state: paused;
}
.fixed-ratio-resize{
height:auto;
max-width: 90%;
}
<img src="image.png" class="fixed-ratio-resize" alt="banner" />
<p class="marquee">
Do not use marquee tag for improve accessibility and readability.
</p>
我想「脫離」從圖像大小調整的動畫,即有圖像調整,只有當視口被更改。 MTIA
您可以用'width',而不是'MAX-width' – Eldeniz