css3写五星红旗

文章借鉴于:html五星红旗写法,html+css生成五星红旗.

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>🚩</title>
    <style type="text/css">
            .qi {
            width: 864px;
            height: 576px;
            background-color: red;
        }
        
        .tri {
            width: 0;
            height: 0;
            top: 90px;
            left: 45px;
            border-left: 100px solid transparent;
            border-right: 100px solid transparent;
            border-bottom: 70px solid yellow;
            position: absolute;
            margin: auto;
            display: block;
            transform: rotate(35deg);
        }
        
        .tri::before {
            content: "";
            height: 0px;
            width: 0px;
            position: absolute;
            display: block;
            top: -45px;
            left: -65px;
            border-right: 30px solid transparent;
            border-bottom: 80px solid yellow;
            border-left: 30px solid transparent;
            transform: rotate(-35deg);
        }
        
        .tri::after {
            content: "";
            width: 0;
            height: 0;
            position: absolute;
            display: block;
            top: 3px;
            left: -105px;
            border-right: 100px solid transparent;
            border-bottom: 70px solid yellow;
            border-left: 100px solid transparent;
            transform: rotate(-70deg);
        }
        
        #one {
            top: 30px;
            left: 280px;
        }
        
        #two {
            top: 80px;
            left: 340px;
        }
        
        #three {
            top: 150px;
            left: 340px;
        }
        
        #four {
            top: 210px;
            left: 280px;
        }
        
        .min {
            width: 0;
            height: 0;
            border-left: 20px solid transparent;
            border-right: 20px solid transparent;
            border-bottom: 14px solid yellow;
            position: absolute;
            margin: auto;
            display: block;
            transform: rotate(35deg);
        }
        
        .min::before {
            content: "";
            height: 0px;
            width: 0px;
            position: absolute;
            display: block;
            top: -10px;
            left: -12px;
            border-right: 6px solid transparent;
            border-bottom: 16px solid yellow;
            border-left: 6px solid transparent;
            transform: rotate(-35deg);
        }
        
        .min::after {
            content: "";
            width: 0;
            height: 0;
            position: absolute;
            display: block;
            top: 0px;
            left: -20px;
            border-right: 20px solid transparent;
            border-bottom: 14px solid yellow;
            border-left: 20px solid transparent;
            transform: rotate(-70deg);
            min
    </style>
</head>

<body>
    <div class="qi"></div>
    <div class="tri"></div>
    <div id="one" class="min"></div>
    <div id="two" class="min"></div>
    <div id="three" class="min"></div>
    <div id="four" class="min"></div>
</body>

</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值