CSS實現選中打鈎(√)樣式


第一種,使用偽標簽 
<span className={'check-style-1'}></span>
.check-style-1 {
  display: inline-block;
  position: relative;
  height: 40px;
  width: 40px;
  border: 2px solid #aaa;
  border-radius: 50%;
}
.check-style-1::after {
  content: ' ';
  position: absolute;
  display: inline-block;
  width: 20px;
  height: 12px;
  border-width: 0 0 2px 2px;
  overflow: hidden;
  border-color: #ff0000;
  border-style: solid;
  -webkit-transform: rotate(-45deg);
  transform: rotate(-45deg);
  left: 9px;
  top: 9px;
}

 

第二種,使用邊框的樣式,進行旋轉 

 

<span className={'check-style-2'}></span>
.check-style-2 {
  display: inline-block;
  width: 20px;
  height: 12px;
  border-left: 2px solid #ff0000;
  border-bottom: 2px solid #ff0000;
  -webkit-transform: rotate(-45deg);
  transform: rotate(-45deg);
}

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM