网站左下角小蛇源码

文章摘要
Code for a small snake animation in the bottom-left corner of a website is provided, including HTML, CSS, and animation styles. Two elements are included, but the author suggests keeping only one. The code uses a fixed position for visibility and applies a rotation animation via keyframes. Styles adjust depending on screen width, hiding the animation on smaller screens. The animation runs infinitely with a delay and duration. The background image for the snake is set with a specified URL and no repeat. Technical details include positioning, width, height, and z-index for layering.
— 文章部分摘要由DeepSeek深度思考而成
图片[1]|网站左下角小蛇源码|不死鸟资源网

复制粘贴

更换图片链接

放到底部就行了 我感觉俩有点多余 就留一个就行了

<div class="dandelion">
  <span class="smalldan"></span>
  <span class="bigdan"></span>
</div>
<style type="text/css">
@media screen and (max-width:600px){
.dandelion{display: none !important;}
}
 .dandelion .smalldan {
width: 36px;
height: 60px;
left: 88px;   
background-position: 0 -90px;
border: 0px solid red;
}
.dandelion span {
-webkit-animation: ball-x 3s linear 2s infinite;
 -moz-animation: ball-x 3s linear 2s infinite;
 animation: ball-x 3s linear 2s infinite;
-webkit-transform-origin: bottom center;
 -moz-transform-origin: bottom center;
 transform-origin: bottom center;
}
.dandelion span {
display: block;
position: fixed;
z-index:9999999999;
bottom: 0px;
background-image: url(图片链接);
background-repeat: no-repeat;
_background: none;
}
.dandelion .bigdan {
  width: 240px;
  height: 240px;
  left: 41px;
  background-position: center center;
  background-size: 100% 100%; /* 确保背景图片完全覆盖容器 */
  border: 0px solid red;
}
@keyframes ball-x {
 0% { transform:rotate(0deg);}
 25% { transform:rotate(5deg); }
 50% { transform:rotate(0deg);}
 75% { transform:rotate(-5deg);}
 100% { transform:rotate(0deg);}  
}
@-webkit-keyframes ball-x {
 0% { -webkit-transform:rotate(0deg);}
 25% { -webkit-transform:rotate(5deg); }
 50% { -webkit-transform:rotate(0deg);}
 75% { -webkit-transform:rotate(-5deg);}
 100% { -webkit-transform:rotate(0deg);}
}
@-moz-keyframes ball-x {
 0% { -moz-transform:rotate(0deg);}
 25% { -moz-transform:rotate(5deg); }
 50% { -moz-transform:rotate(0deg);}
 75% { -moz-transform:rotate(-5deg);}
 100% { -moz-transform:rotate(0deg);}
}
</style>
本站资源均为作者提供和网友推荐收集整理而来,仅供学习和研究使用,请在下载后24小时内删除,谢谢合作!
网站左下角小蛇源码|不死鸟资源网
网站左下角小蛇源码
此内容为免费阅读,请登录后查看
¥0
限时特惠
¥99
文章采用CC BY-NC-SA 4.0许可协议授权
免费阅读
THE END
点赞14 分享