即使使用!important

问题描述

我有一个活跃的儿童主题,叫做“ Hello Elementor Child”。由于其他人在覆盖Elementor并向每个CSS规则添加!important时遇到问题,因此我也做了同样的事情。

我的问题是没有什么可以覆盖。当我“查看源代码”并找到主页上使用的背景图像时,我可以确认到该图像的链接是好的。但是,它根本没有出现在网站上。

我不想将所有自定义代码添加到Elementor编辑器(或CSS插件),因为(1)我没有此精打细算的客户端的专业版,并且(2)我不要一堆头中的代码

style.css文档 https://trimedia.co/hccpersonalcare/wp-content/themes/hello-theme-child-master/style.css?ver=1.0.0

链接到背景图片,以便您了解其外观:https://trimedia.co/hccpersonalcare/wp-content/themes/hello-theme-child-master/images/men-masked-personal-care-wide.jpg

测试位置为https://trimedia.co/hccpersonalcare

解决方法

如果缩小浏览器的视口,则会看到一个背景图像。问题出在您的媒体查询上,@media all and (max-width:600px)缺少右括号。您在那里有很多查询,我建议在少数几个常见断点下对代码进行分块,以便您可以跟踪哪些覆盖了更好的覆盖。