css写一个简单的三角形,绿色的哦

<!doctype html>
<html ng-app>
<head>
<meta content="charset=utf-8">
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <style type="text/css">
        .caret {  
            width: 0;
            height: 0;
            border-width: 0 20px 20px;
            border-color: transparent transparent green;
            border-style: solid;
        }  
    </style>
</head>
<body>
    <div class="caret"></div>
</body>
</html>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是一个简单的 HTML 5 代码,可以创建一个圣诞树: ```html <!DOCTYPE html> <html> <head> <title>圣诞树</title> <style> body { background-color: #f8f8f8; } .tree { display: flex; flex-direction: column; align-items: center; margin-top: 50px; } .tree:before { content: ""; display: block; width: 0; height: 0; border-left: 50px solid transparent; border-right: 50px solid transparent; border-bottom: 100px solid green; } .tree ul { list-style: none; padding: 0; margin: 0; position: relative; top: -50px; } .tree ul li { display: inline-block; background-color: yellow; width: 30px; height: 30px; border-radius: 50%; margin: 0 5px; position: relative; animation: twinkle 1s infinite linear; } .tree ul li:before, .tree ul li:after { content: ""; display: block; position: absolute; top: -15px; left: 50%; width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 15px solid yellow; transform: translateX(-50%); } .tree ul li:before { border-bottom: 10px solid yellow; top: -10px; } @keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } } </style> </head> <body> <div class="tree"> <ul> <li></li> <li></li> <li></li> <li></li> <li></li> </ul> </div> </body> </html> ``` 这段代码创建了一个绿色三角形形状的圣诞树,并在树上使用黄色的球体来装饰。这里使用了 CSS 动画来使球体闪烁。你可以将其复制到一个 HTML 文件中,然后在浏览器中打开文件以查看效果。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值