按钮内的Gif(HTML, CSS)

问题描述 投票:-1回答:1

我在寻找一种在按钮内显示gif的方法,按钮内应该有一个gif,在悬停时开始播放。

html css button gif
1个回答
0
投票

那么,你需要使用CSS

<style>
.button {
background: url('gifname.gif');
border: none;
background-repeat: no-repeat;
object-fit: cover;
}
</style>
<button class="button">

希望能解决你的问题

© www.soinside.com 2019 - 2024. All rights reserved.