好玩的css小样式,勾、叉、三角、大于号

<div class="content">
	<div class="gou"></div>
	<div class="cha"></div>
	<div class="sanjiao"></div>
	<div class="dayu"></div>
</div>


在这里插入图片描述

    .gou {
      height: 30px;
      width: 30px;
      position: relative;
    }
    .gou::before,
    .gou::after {
      content: "";
      width: 2px;
      background-color: red;
      position: absolute;
      left: 8px;
      bottom: 8px;
    }
    .gou::before {
      height: 30px;
      transform-origin: left bottom; /*改变旋转中心点*/
      transform: rotate(45deg);
    }
    .gou::after {
      height: 16px;
      transform-origin: right bottom;
      transform: rotate(-45deg);
    }


在这里插入图片描述

    .cha {
      height: 30px;
      width: 30px;
      position: relative; /*定位伪元素 */
    }
    .cha::before,
    .cha::after {
      content: "";
      height: 30px;
      width: 2px;
      display: block;
      background-color: red;
      position: absolute;
      left: 13px;
    }
    .cha::before {
      transform: rotate(45deg); /*旋转角度 */
    }
    .cha::after {
      transform: rotate(-45deg);
    }

在框上方画小三角
在这里插入图片描述

    .sanjiao {
      height: 0px;
      width: 0px;
      border-right: 20px solid transparent;  /*利用transparent属性,讲左右边框变为透明*/
      border-left: 20px solid transparent;
      border-bottom: 20px solid red;
    }

画大于号
在这里插入图片描述

    .dayu {
      height: 30px;
      width: 30px;
      position: relative;
    }
    .dayu::before,
    .dayu::after {
      content: "";
      height: 16px;
      width: 2px;
      background-color: red;
      position: absolute;
      right: 8px;
      transform-origin: center bottom;
    }
    .dayu::before {
      transform: rotate(-60deg);
    }
    .dayu::after {
      transform: rotate(-120deg);
    }
  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值