【问题标题】:fixing padding for custom icon using Twitter Bootstrap使用 Twitter Bootstrap 修复自定义图标的填充
【发布时间】:2012-07-31 16:06:27
【问题描述】:

我的问题和How to add custom icon in Twitter Bootstrap的问题一样

上述问题的答案中How to add custom icon in Twitter Bootstrap 的解决方案看起来很棒。我唯一想问的是如何在左边的图标和右边的 30px 图标之间设置 20px。我使用的图标不是标准的 14x14 pxpx,所以我再次使用了enter link description here

谢谢。

【问题讨论】:

    标签: html css twitter-bootstrap icons padding


    【解决方案1】:

    只需将填充添加到您创建的自定义类中,如下所示:

    CSS

    .icon-car {
        background-image: url("http://cdn5.iconfinder.com/data/icons/Symbolicons_Transportation/24/Car.png");
        background-position: center center;
        height: 24px;
        line-height: 24px;
        width: 24px;
        padding-left:20px;
        padding-right:30px;
    }
    

    演示:http://jsfiddle.net/RwFeu/7/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-03-26
      • 2023-03-05
      • 2013-11-23
      • 2013-02-04
      • 1970-01-01
      • 2013-03-28
      • 1970-01-01
      相关资源
      最近更新 更多