>  Q&A  >  본문

css - weui中的icons是什么?怎么用呢?

  <link rel="stylesheet" type="text/css" href="weui.css" />

<i class="weui_icon_msg weui_icon_success"></i>
<i class="weui_icon_msg weui_icon_info"></i>
<i class="weui_icon_msg weui_icon_warn"></i>
<i class="weui_icon_msg weui_icon_waiting"></i>
<i class="weui_icon_safe weui_icon_safe_success"></i>
<i class="weui_icon_safe weui_icon_safe_warn"></i>
<p class="icon_sp_area">
    <i class="weui_icon_success"></i>
    <i class="weui_icon_success_circle"></i>
    <i class="weui_icon_success_no_circle"></i>
    <i class="weui_icon_info"></i>
    <i class="weui_icon_waiting"></i>
    <i class="weui_icon_waiting_circle"></i>
    <i class="weui_icon_circle"></i>
    <i class="weui_icon_warn"></i>
    <i class="weui_icon_download"></i>

我照着代码试了,怎么什么都没有?

另外,<i> </i>标签不是表示斜体的吗,怎么用在了这里?

PHPzPHPz2765일 전672

모든 응답(3)나는 대답할 것이다

  • PHPz

    PHPz2017-04-17 13:41:52

    搜一下font-awesome . ..一种图标字体,如果没有效果,你看看目录下是否导入了那些字体文件,或者在F12里面看看字体对应的路径是否正确

    회신하다
    0
  • 迷茫

    迷茫2017-04-17 13:41:52

    另外, 标签不是表示斜体的吗,怎么用在了这里?

    非常恰巧昨晚我才看到了一个教学的网站教了这个,他的原文如下

    In this case, we've already added it for you to this page behind the scenes. The i element was originally used to make other elements italic, but is now commonly used for icons. You add the Font Awesome classes to the i element to turn it into an icon, for example: Use Font Awesome to add a thumbs-up icon to your like button by giving it an i element with the classes fa andfa-thumbs-up.

    I 元素最初被用于使其他元素倾斜,而现在常用的图标。将字体令人敬畏的类添加到 i 元素把它变成一个图标,例如︰

    下面是我自己写的一个按钮,但是用的是font-awesome的一个图标库,但是我觉得和weui应该是一致的。

    <button><i class="fa fa-thumbs-up"></i>LIKE</button>
    
    

    회신하다
    0
  • 阿神

    阿神2017-04-17 13:41:52

    因为weui版本的问题。
    0.4版本是weui_icon_success,下划线。
    1.0版本是weui-icon-success,中划线。
    恼火啊,标准不统一。。。

    회신하다
    0
  • 취소회신하다