Unicode character for “X” cancel / close?

前端 未结 17 1938
我在风中等你
我在风中等你 2021-01-29 17:18

I want to create a close button using CSS only.

I\'m sure I\'m not the first to do this, so does anyone know which font has an \'x\' the same width as height, so that it

17条回答
  •  走了就别回头了
    2021-01-29 17:59

    Using modern browsers you can rotate a + sign:

    .popupClose:before {
        content:'+';
    }
    .popupClose {
        position:relative;
        float:right;
        right:10px;
        top:0px;
        padding:2px;
        cursor:pointer;
        margin:2px;
        color:grey;
        font-size:32pt;
        transform:rotate(45deg);
    }
    

    then simply place the following html where you need:

     
    

提交回复
热议问题