gpt4 book ai didi

css - 覆盖 canvas woo 主题的移动响应 css

转载 作者:行者123 更新时间:2023-11-28 15:31:49 26 4
gpt4 key购买 nike

我正在使用 woo canvas 主题开发网站。我想为移动响应布局添加自定义 css。Canvas 是响应式的,但我想添加自定义 css 以更改字体大小等。我正在使用以下代码在我的 Canvas 子主题 style.css 中添加 css,但更改未反射(reflect)在前端....请帮助

// For mobile devices
@media only screen and (min-device-width : 320px) and (max-device-width : 480px){
/* custom css ----------- */
}
and so on for other devices

最佳答案

实际上,WordPress 子主题的主要好处之一是它可以覆盖原始的 style.css。事实上,child theme 中唯一需要的文件是一个正确编写的 style.css

但一个问题是 Canvas 有时会使用 get_template_directory_uri() , 它返回父主题样式,而不是 get_stylesheet_directory_uri() ,返回子主题样式。要改为使用您的子主题样式,您可以根据需要在 /includes/theme-actions.php 中更改子主题中的功能。我必须为 layout.cssnon-responsive.css 这样做。

在 CSS 中使用 !importantoften a bad idea .

关于css - 覆盖 canvas woo 主题的移动响应 css,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20138449/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com