X close button only using css

后端 未结 8 1554
感情败类
感情败类 2020-12-25 10:21

How to make a cross (X) only in css3, to use as a close button ?

I\'ve been searching since long time, i cannot found how.... When i look at source code on website u

8条回答
  •  情歌与酒
    2020-12-25 11:12

    Main point you are looking for is:

    .tag-remove::before {
      content: 'x'; // here is your X(cross) sign.
      color: #fff;
      font-weight: 300;
      font-family: Arial, sans-serif;
    }
    

    FYI, you can make a close button by yourself very easily:

    #mdiv {
      width: 25px;
      height: 25px;
      background-color: red;
      border: 1px solid black;
    }
    
    .mdiv {
      height: 25px;
      width: 2px;
      margin-left: 12px;
      background-color: black;
      transform: rotate(45deg);
      Z-index: 1;
    }
    
    .md {
      height: 25px;
      width: 2px;
      background-color: black;
      transform: rotate(90deg);
      Z-index: 2;
    }

提交回复
热议问题