css实现上下左右对勾选中状态角标

css实现上下左右对勾选中状态角标

码农世界 2024-05-13 前端 65 次浏览 0个评论

🍥左上角

🍥右上角

🍥左下角

🍥右下角:


🍥左上角:
  .blueBackground {
    position: relative;
    border: 1px solid #91c7f3;
    background: #F0F8FF !important;
    &:after {
      content: "";
      position: absolute;
      top: 0;
      left: 0;
      border-top: 17px solid #2D52D8FF;
      border-right: 17px solid transparent;
    }
    &:before {
      content: "";
      position: absolute;
      width: 8px;
      height: 4px;
      background: transparent;
      top: 4px;
      left: 0px;
      border: 1.5px solid white;
      border-top: none;
      border-right: none;
      -webkit-transform: rotate(-50deg);
      -ms-transform: rotate(-50deg);
      transform: rotate(-50deg);
      z-index: 9;
    }
}

🍥 右上角:
  .blueBackground {
    position: relative;
    border: 1px solid #91c7f3;
    background: #F0F8FF !important;
    &:after {
      content: "";
      position: absolute;
      top: 0;
      right: 0;
      border-top: 17px solid #2D52D8FF;
      border-left: 17px solid transparent;
    }
    &:before {
      content: "";
      position: absolute;
      width: 8px;
      height: 4px;
      background: transparent;
      top: 4px;
      right: 0px;
      border: 1.5px solid white;
      border-top: none;
      border-right: none;
      -webkit-transform: rotate(-50deg);
      -ms-transform: rotate(-50deg);
      transform: rotate(-50deg);
      z-index: 9;
    }
  }

🍥左下角:
.blueBackground {
    position: relative;
    border: 1px solid #91c7f3;
    background: #F0F8FF !important;
    &:after {
      content: "";
      position: absolute;
      bottom: 0;
      left: 0;
      border-bottom: 17px solid #2D52D8FF;
      border-right: 17px solid transparent;
    }
    &:before {
      content: "";
      position: absolute;
      width: 8px;
      height: 4px;
      background: transparent;
      bottom: 4px;
      left: 0px;
      border: 1.5px solid white;
      border-top: none;
      border-right: none;
      -webkit-transform: rotate(-50deg);
      -ms-transform: rotate(-50deg);
      transform: rotate(-50deg);
      z-index: 9;
    }
  }

🍥右下角: 
.blueBackground {
    position: relative;
    border: 1px solid #91c7f3;
    background: #F0F8FF !important;
    &:after {
      content: "";
      position: absolute;
      bottom: 0;
      right: 0;
      border-bottom: 17px solid #2D52D8FF;
      border-left: 17px solid transparent;
    }
    &:before {
      content: "";
      position: absolute;
      width: 8px;
      height: 4px;
      background: transparent;
      bottom: 4px;
      right: 0px;
      border: 1.5px solid white;
      border-top: none;
      border-right: none;
      -webkit-transform: rotate(-50deg);
      -ms-transform: rotate(-50deg);
      transform: rotate(-50deg);
      z-index: 9;
    }
  }

转载请注明来自码农世界,本文标题:《css实现上下左右对勾选中状态角标》

百度分享代码,如果开启HTTPS请参考李洋个人博客
每一天,每一秒,你所做的决定都会改变你的人生!

发表评论

快捷回复:

评论列表 (暂无评论,65人围观)参与讨论

还没有评论,来说两句吧...

Top