Javascript 如何更改一个特定的CSS类

Javascript 如何更改一个特定的CSS类,javascript,css,wordpress,Javascript,Css,Wordpress,我有一个问题,我已经通过Wordpress开发了一个网站,并希望以一种方式设计所有产品的价格,以另一种方式设计小计、税和总额。它们都在一个CSS类中,就像woocommerce的价格和金额一样。我是否只能针对tr cart_项目中的项目?谢谢大家! <table class="shop_table woocommerce-checkout-review-order-table" style="border-color: rgb(255, 255, 255);"> <thead

我有一个问题,我已经通过Wordpress开发了一个网站,并希望以一种方式设计所有产品的价格,以另一种方式设计小计、税和总额。它们都在一个CSS类中,就像woocommerce的价格和金额一样。我是否只能针对tr cart_项目中的项目?谢谢大家!

 <table class="shop_table woocommerce-checkout-review-order-table" style="border-color: rgb(255, 255, 255);">
<thead style="background-color: rgb(0, 0, 0);">
    <tr>
        <th class="product-name" style="border-color: rgb(255, 255, 255); color: rgb(255, 255, 255);">Product</th>
        <th class="product-total" style="border-color: rgb(255, 255, 255); color: rgb(255, 255, 255);">Total</th>
    </tr>
</thead>
<tbody>
                        <tr class="cart_item">
                    <td class="product-name" style="border-color: rgb(255, 255, 255);">
                        Autumn Leaf Shirt - Large&nbsp;                          <strong class="product-quantity">× 2</strong>                                                  </td>
                    <td class="product-total" style="border-color: rgb(255, 255, 255);">
                        <span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">$</span>70.00</span>                       </td>
                </tr>
                    </tbody>
<tfoot>

    <tr class="cart-subtotal">
        <th style="background-color: rgb(0, 0, 0); border-color: rgb(255, 255, 255); color: rgb(255, 255, 255);">Subtotal</th>
        <td style="border-color: rgb(255, 255, 255);"><span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">$</span>70.00</span></td>
    </tr>




                                <tr class="tax-total">
                <th style="background-color: rgb(0, 0, 0); border-color: rgb(255, 255, 255); color: rgb(255, 255, 255);">Tax</th>
                <td style="border-color: rgb(255, 255, 255);"><span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">$</span>0.00</span></td>
            </tr>


    <tr class="order-total">
        <th style="background-color: rgb(0, 0, 0); border-color: rgb(255, 255, 255); color: rgb(255, 255, 255);">Total</th>
        <td style="border-color: rgb(255, 255, 255);"><strong><span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">$</span>70.00</span></strong> </td>
    </tr>


</tfoot>

对!!您可以将购物车项目中的woocommerce价格项目明确定位为:

.cart_项目。商品价格金额{ /**你在这里的财产**/ }

这将仅将您的属性应用于具有类cart\u item的元素中具有类woocommerce Price amount的元素

基本上,在CSS中,您可以通过以下方式访问foo中的工具栏:

.foo.bar{ }