Alternative to ☐ and ☒ on Android (Samsung Tab 2) browser

北城余情 提交于 2020-01-05 07:36:33

问题


Internet browser I have installed (by default) on my Samsung Tab2 does not display ☐☐ and ☒☒ characters properly. What are alternative solutions?


回答1:


The fonts on Android do not contain these characters, so your options seem to be:

  1. Use a downloadable font, via @font-face. It can be difficult to find a font suitable for this, since most free fonts are rather limited in their character coverage. Among the relatively few fonts that contain these characters (cf. to font coverage info at Fileformat.info), DejaVu Sans might be suitable (though somewhat large in file size, about 668 kilobytes).
  2. Use images. A bit dull these days, but a working solution. In this case, create images that are several times larger than expected font size and scale them down to match the font size, using e.g. width: 0.6em for the images.
  3. Use a no-break space and the multiplication sign “×” and put, with CSS, them into small boxes with borders. Sample code below. This seems to be the best approach here.

    <style>
    .box {
      display: inline-block;
      vertical-align: baseline;
      line-height: 0.6;
      border: solid 0.08em;
      width: 0.6em;
      height: 0.6em;
      text-align: center;
      font-weight: bold;
    }
    </style>
    <span class=box>&nbsp;</span>
    <span class=box>&times;</span>
    


来源:https://stackoverflow.com/questions/12825609/alternative-to-x2610-and-x2612-on-android-samsung-tab-2-browser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!