【问题标题】:Change custom discount price percentage styling in WooCommerce single products更改 WooCommerce 单品中的自定义折扣价格百分比样式
【发布时间】:2019-10-03 06:01:34
【问题描述】:

我正在使用 "Display the default discounted price and percentage on Woocommerce products" 答案代码(用于简单产品),我希望显示的输出字体为粗体、红色和大号,用于此行:

sprintf( __('<p class="saved-sale">Save: %s <em>(%s)</em></p>', 'woocommerce' ), $saving_price, $saving_percentage );

如何做到这一点?任何帮助表示赞赏。

【问题讨论】:

    标签: css wordpress woocommerce product discount


    【解决方案1】:

    您将使用 .saved-sale 类定位段落元素。

    在你的 CSS 中你可以这样写:

    p.saved-sale {
     font-weight: bold;
     color: FF0000;
     font-size: larger;
    }
    

    查看font-size on the MDN Web Docs 了解如何增大或减小字体大小。

    【讨论】:

      猜你喜欢
      • 2018-07-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多