Unicode character for “X” cancel / close?

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

    This is probably pedantry, but so far no one has really given a solution "to create a close button using CSS only." only. Here you go:

    #close:before {
      content: "✖";
      border: 1px solid gray;
      background-color:#eee;
      padding:0.5em;
      cursor: pointer;
    }
    

    http://codepen.io/anon/pen/VaWqYg

提交回复
热议问题