简体   繁体   English

更改文字颜色

[英]Changing text color

I have managed to change the color of other text in my woocommerce shop by using the simple custom CSS plugin for WordPress. 通过使用用于WordPress的简单自定义CSS插件,我设法更改了woocommerce商店中其他文本的颜色。 But there is 1 text section that will not change. 但是有1个文本部分不会改变。 When you go into the shop and click on SkinCare and soaps and click the cupcake soap it says "6 in stock" which is yellow. 当您进入商店并单击SkinCare和香皂并单击纸杯蛋糕香皂时,上面写着“ 6存货”,它是黄色的。 I want to change it to black. 我想将其更改为黑色。 The site is http://84f.6c5.myftpupload.com/ and my CSS for it is 该站点为http://84f.6c5.myftpupload.com/ ,我的CSS为

.woocommerce .stock in-stock   {
  color: #000000;
}

This has got my stumped as the others changed but not this one. 随着其他人的改变,这让我感到很沮丧,但没有改变。 Thanks Linda 谢谢琳达

You need to apply the two classes simultaneously: 您需要同时应用两个类:

.woocommerce .stock.in-stock   {
  color: #000000;
}

This selected means apply the properties to an element that has both .stock and .instock as classes. 这种选择的方式将属性应用于同时具有.stock.instock作为类的元素。

The CSS will work regardless of the order that the two classes are applied. 不管两个类的应用顺序如何,CSS都可以工作。

Applying the style in WordPress 在WordPress中应用样式

The style you want to modify is the following: 您要修改的样式如下:

.woocommerce div.product .stock {
    color: #1E1313;
}

which is located in the woocommerce.css file. 位于woocommerce.css文件中。 You need to find this file, modify the current CSS rule or add the one I suggested, and then you need to upload the edited woocommerce.css file onto you hosting server. 您需要找到此文件,修改当前的CSS规则或添加我建议的规则,然后需要将编辑后的woocommerce.css文件上传到托管服务器。 I checked your website and the style I suggested has not been added to your site. 我检查了您的网站,但我建议的样式尚未添加到您的网站。

Your CSS is wrong. 您的CSS错误。 in-stock is a class but you're identifying it as tag. in-stock是一类,但您将其标识为标签。 Also, in-stock is not defined within stock . 同样, in-stock中未定义stock The correct implementation would be 正确的实现是

.woocommerce .stock.in-stock   {
  color: #000000;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM