style.css not working but customizer additional css does?

I'm using a woocommerce template on my site, when i add some additional CSS it doesn't show but when i put the

I'm using a woocommerce template on my site, when i add some additional CSS it doesn't show but when i put the same code into the customizer - additional css within wordpress it works fine.

I've tested this on the original theme and also made a child theme but still does not work.

Does anybody know whats going on?

Regards, Billy

I'm using a woocommerce template on my site, when i add some additional CSS it doesn't show but when i put the same code into the customizer - additional css within wordpress it works fine.

I've tested this on the original theme and also made a child theme but still does not work.

Does anybody know whats going on?

Regards, Billy

Share Improve this question asked Aug 6, 2019 at 11:13 BuzzinBillyBuzzinBilly 212 bronze badges 2
  • Are you maybe adding your markup to style.css so that it gets overridden? If there is other code further down the file that negates your earlier changes, you don't see any effect on your site. You can check this with your browser developer tools. Let me know if any of this is unclear. – WSU Commented Aug 6, 2019 at 13:37
  • thanks WSU, yes seems code is being overridden but cant see where, can i force my child theme style.css to load last? – BuzzinBilly Commented Aug 7, 2019 at 15:26
Add a comment  | 

1 Answer 1

Reset to default 1

There's nothing special about CSS in WordPress. It follows the same rules of specificity that apply everywhere else. This means that the order of rules are can affect how they're applied.

In WordPress the styles from plugins are typically output after the styles from themes, and styles from Additional CSS are output last. So if you have a CSS selector with the exact same specificity in your theme, a plugin, and the customiser, then the customiser will take precedence over the plugin, which will take precedence over the theme.

So if you need to overwrite some CSS in a plugin from your theme, you need to make the rule more specific.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745265552a4619431.html

相关推荐

  • style.css not working but customizer additional css does?

    I'm using a woocommerce template on my site, when i add some additional CSS it doesn't show but when i put the

    3小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信