代码之家  ›  专栏  ›  技术社区  ›  Joe Bloggs

字体很棒的Unicode-如何将图标一直向右浮动

  •  0
  • Joe Bloggs  · 技术社区  · 6 年前

    <i></i>

    #menu li a:after {
      font-family: FontAwesome;
      content: "\f054";
      display: inline-block;
      float: right;
      padding-left: 10px;
      vertical-align: middle;
    }
    

    The icon appears next to the link on the right which is correct, but how can I align the icon all the way to the right??

    一直到菜单宽度的末尾。

    float: right

    1 回复  |  直到 6 年前
        1
  •  3
  •   KANAYO AUGUSTIN UG    6 年前

    位置 正确的

    #menu li a:after {
      font-family: FontAwesome;
      content: "\f054";
      position: absolute;
      right: 0px;
      padding-left: 10px;
      vertical-align: middle;
    }