css3绘制常见的30种形状(心形,五角星,六边形,钻石,对话框,阴阳鱼图等)

本文介绍了使用CSS3绘制的30种常见形状,包括心形、五角星、六边形、钻石等。通过CSS3的新特性,可以更简单高效地实现这些图形,为网页设计提供丰富元素。
摘要由CSDN通过智能技术生成

CSS实现圆角三角五角星五边形爱心12角星8角星椭圆圆圈八卦等等
新出的html5新增了不少标签,性能更强,原来的很繁琐的功能几个标签就能实现,同时CSS3也推出,更是一大亮点,下面是css3的部分用法,在此总结一下,以供需要的朋友们,总共30个例子

  • 长方形
#Rectangle{
        width: 200px;
        height: 50px;
        background-color: red;
        color: white;  
        text-align: center;
}

  • 正方形
#square{
        width: 200px;
        height: 200px;
        background-color: red;
        color: white;
        text-align: center;
}

  • 实心圆
#perfect-circle{
        width: 200px;
        height: 200px;
        background-color: red;
        color: white;
        text-align: center;
        border-radius: 100px;
        /*-webkit-border-radius: 100px;*/
        -moz-border-radius: 100px;
}

#circle{
        width: 200px;
        height: 200px;
        background-color: white;
        color: black;
        text-align: center;
        border-radius: 100px;
        /*-webkit-border-radius: 10px;*/
        /*-moz-border-radius: 100px;*/
        border:3px red solid;
}

  • 椭圆
#ellipse{
          width: 200px;
          height: 100px;
          background-color: red;
          color: white;text-align: center;
          border-radius: 100px/50px;
          /*-webkit-border-radius: 100px/50px;*/
          /*-moz-border-radius: 100px/50px;*/
}

  • 上三角
#triangle-up {
        width: 0px;
        height: 0px;
        color: white;
        text-align: center;
        border-left: 50px solid transparent;
        border-right: 50px solid transparent;
        border-bottom: 100px solid red;
        /*-webkit-border-top-left-radius: 50px solid transparent;*/
        /*-webkit-border-top-right-radius: 50px solid transparent;*/
        /*-webkit-border-bottom-left-radius: 100px solid red;*/
        /*-webkit-border-bottom-right-radius: 100px solid red;*/
    }

  • 下三角
#triangle-down{
        width: 0px;
        height: 0px;
        color: white;
        text-align: center;
        border-top: 100px solid red;
        border-left: 50px solid transparent;
        border-right: 50px solid transparent;
}

  • 左三角
#triangle-left{
        width: 0px;
        height: 0px;
        color: white;
        text-align: center;
        border-top: 50px solid transparent;
        bor
  • 2
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值