最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

css - How can I avoid conflicts between plugin and theme?

programmeradmin2浏览0评论

I'm developing a widget for wp elementor as a plugin. Now my widget front view css and the theme front view css are in conflict. Right now as a developer how can I avoid wp plugin front view css and theme front view css conflict?

I'm developing a widget for wp elementor as a plugin. Now my widget front view css and the theme front view css are in conflict. Right now as a developer how can I avoid wp plugin front view css and theme front view css conflict?

Share Improve this question edited Jan 18, 2022 at 8:53 fuxia 107k38 gold badges255 silver badges459 bronze badges asked Jan 18, 2022 at 6:42 FERDAUSSK 01FERDAUSSK 01 1 1
  • 3 There’s no magic trick. You just need to write your CSS rules with appropriate specificity so that rules you want to be overwritten can be while important CSS is not overwritten. – Jacob Peattie Commented Jan 18, 2022 at 7:10
Add a comment  | 

1 Answer 1

Reset to default 5

You can/should prefix all your classes. That way you have very limited chance to have conflicting classes, which can cause unexpected behaviour on the front-end. So, instead of .container, you can use .mypluginprefix_container.

发布评论

评论列表(0)

  1. 暂无评论