HTML小网页制作,

这是效果图,是个动图,

你也可以换成其他图片。

没有限制,改完图片别忘了调一下图片大小,不然影响美观。

css部分,

<style>
        body { background-color:lightBlue; }
        #snow{
            background: none;
            font-family: Androgyne;
            background-image: url('/corndog-tile-1.png'), url('/corndog-tile.png'), url('/corndog-tile-2.png');
            height: 100%;
            left: 0;
            position: absolute;
            top: 0;
            width: 100%;
            z-index:1;
            -webkit-animation: snow 1000s linear infinite;
            -moz-animation: snow 1000s linear infinite;
            -ms-animation: snow 1000s linear infinite;
            animation: snow 1000s linear infinite;
            -webkit-transform: translate3d(0,0,0);
            -moz-transform: translate3d(0,0,0);
            -ms-transform: translate3d(0,0,0);
            -o-transform: translate3d(0,0,0);
            transform: translate3d(0,0,0);
        }
        @keyframes snow {
          0% {background-position: 0px 0px, 0px 0px, 0px 0px;}
          100% {background-position: 50000px 50000px, 10000px 20000px, -10000px 15000px;}          
        }
        @-moz-keyframes snow {
          0% {background-position: 0px 0px, 0px 0px, 0px 0px;}
          100% {background-position: 50000px 50000px, 10000px 20000px, -10000px 15000px;}          
        }
        @-webkit-keyframes snow {
          0% {background-position: 0px 0px, 0px 0px, 0px 0px;}
          100% {background-position: 50000px 50000px, 10000px 20000px, -10000px 15000px;}          
        }
        @-ms-keyframes snow {
          0% {background-position: 0px 0px, 0px 0px, 0px 0px;}
          100% {background-position: 50000px 50000px, 10000px 20000px, -10000px 15000px;}          
        }   
    </style>

主题给个div,加个ID就行了。

我的是

<div id="snow">

这个小网页用不到 js,大体都是css基础。

也可以在 HTML/CSS/Javascript在线代码运行工具 | 菜鸟教程 这里运行一下看效果,别忘了加div和ID

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值