【问题标题】:adding icon beside woocomerce add to card button在 woocommerce 旁边添加图标添加到购物车按钮
【发布时间】:2017-03-12 09:34:45
【问题描述】:

我是编码新手,所以我正在为我的商店使用 wordpress 和 woocomerce,请查看下面的图片,这是我的计划。但是你能教我正确的方法吗?

如何将图片放在添加到购物车文本之前?

.prod_cart a.button.product_type_simple.add_to_cart_button.ajax_add_to_cart {
    text-align: center;
    margin-top: 20px;
    border: 1px solid #000;
    border-radius: 5px;
    font-size: 15px;
    background-color: transparent;
        background: url('../img/1.png') no-repeat;

}

【问题讨论】:

  • 使用图标字体。现在没有人使用图像来制作单色图标了。

标签: php html css wordpress woocommerce


【解决方案1】:

您应该添加display:blockdisplay:inline-block 并将背景更改为background:url('../img/1.png') no-repeat left 10px center transparent

left 10px 将图像定位在距离按钮左侧 10px 的位置。此外,您应该为按钮设置一些填充或设置宽度和高度。

【讨论】:

    猜你喜欢
    • 2016-09-05
    • 2018-09-30
    • 2014-10-28
    • 2018-05-08
    • 2018-04-12
    • 2018-08-11
    • 2018-10-30
    • 1970-01-01
    相关资源
    最近更新 更多