太阳系小案例--H5C3

太阳系小案例

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <style>
        body{
            background-color: #000;
        }
        .sun{
            width: 100px;
            height: 100px;
            background-color: orange;
            position: absolute;
            left:50%;
            top:50%;
            margin-left:-50px;
            margin-top:-50px;
            border-radius: 50%;
            box-shadow: 0 0 30px 2px yellow;
        }

        .earth{
                width: 300px;
                height: 300px;
                position: absolute;
                left:50%;
                top:50%;
                margin-left:-150px;
                margin-top:-150px;
                border-radius: 50%;
                border: 1px solid #ccc;
                /*animation: rot 5s linear infinite;*/

            }

        .earth::after{
            width: 30px;
            height: 30px;
            position: absolute;
            left:0%;
            top:50%;
            margin-left:-15px;
            margin-top:-15px;
            border-radius: 50%;
            background-color: dodgerblue;
            content:"";
        }

        .moon{
            width: 10px;
            height: 10px;
            background-color: #fff;
            border-radius: 50%;
            position: absolute;
            left:-25px;
            top:50%;
            margin-left: -5px;
            margin-top:-5px;
            transform-origin: 30px 5px;
            animation: rot 3s linear infinite;
        }


        .mars{
            width: 400px;
            height: 400px;
            position: absolute;
            left:50%;
            top:50%;
            margin-left:-200px;
            margin-top:-200px;
            border-radius: 50%;
            border: 1px solid #ccc;

            animation: rot 8s linear infinite;

        }

        .mars::after{
            width: 20px;
            height: 20px;
            position: absolute;
            left:0%;
            top:50%;
            margin-left:-10px;
            margin-top:-10px;
            border-radius: 50%;
            background-color: gold;
            content:"";
        }

        .venus{
            width: 500px;
            height: 500px;
            position: absolute;
            left:50%;
            top:50%;
            margin-left:-250px;
            margin-top:-250px;
            border-radius: 50%;
            border: 1px solid #ccc;
            animation: rot 10s linear infinite;

        }

        .venus::after{
            width: 40px;
            height: 40px;
            position: absolute;
            left:0%;
            top:50%;
            margin-left:-20px;
            margin-top:-20px;
            border-radius: 50%;
            background-color: red;
            content:"";
        }

        @keyframes rot {
            0%{

            }

            100%{
                transform:rotate(360deg);
            }
        }
    </style>
</head>
<body>
    <div class="sun"></div>
    <div class="earth">
        <div class="moon"></div>
    </div>
    <div class="mars"></div>
    <div class="venus"></div>
</body>
</html>

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值