CSS in child theme for mobile not cascading
-
I have searched forum posts on this topic but my problem seems to be different. I am using a themeswitcher plugin to detect mobile devices and switch to a handheld theme or tablet theme when appropriate. The handheld and tablet themes are set up as children of the primary theme.
Each child theme has a style.css file beginning
/* Theme Name: Theme name here Description: Description here Template: Name of the parent theme here */ @import url(URL of the parent theme's stylesheet here);
and then all the child theme CSS.
Each child theme has its own header file, and I’m using
<link rel="stylesheet" href="(URL of the child theme's stylesheet)" type="text/css" />
So this isn’t a problem with linking to the template directory’s stylesheet, as was the case with many others who asked this question previously in this forum. I’m also not using any caching plugins, and i’ve cleared cache and that has not resolved the issue.
My child theme stylesheet is being loaded, and new styles are being applied correctly; it’s just that they aren’t overriding the parent theme styles if they were previously declared — the cascade isn’t working. It’s like the child styles are being loaded first somehow and then the parent styles are overriding them. The only way I can get the child theme styles to display correctly is to add !important; after every single line of css, which is obviously a lousy solution.
Does anybody have any ideas about why this is happening?
- The topic ‘CSS in child theme for mobile not cascading’ is closed to new replies.