Unicode character for “X” cancel / close?

前端 未结 17 1937
我在风中等你
我在风中等你 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 18:06

    HTML



    × × ×

    CSS

    If you want to use the above characters from CSS (like i.e: in an :before or :after pseudo) simply use the escaped \ Unicode HEX value, like for example:

    [class^="ico-"], [class*=" ico-"]{
      font: normal 1em/1 Arial, sans-serif;
      display: inline-block;
    }
    
    
    .ico-times:before{ content: "\2716"; }
    .ico-check:before{ content: "\2714"; }
    
    

    Use examples for different languages:

    • HTML
    • '\2715' CSS like i.e: .clear:before { content: '\2715'; }
    • '\u2715' JavaScript string

    https://home.unicode.org/

提交回复
热议问题