I am having problems in using CSS on my image banner!!
Everything I try to modify does not work.
Can you please hel me in solving it?
mohwhi
A user is experiencing issues applying CSS modifications to an image banner in the Dawn theme. None of their attempted CSS changes are taking effect.
Root Cause Identified:
{{ section.id }}) cannot be processed inside .css files#Banner-{{ section.id }} as a selector in a CSS file, which won’t work since section is undefined in that contextRecommended Solutions:
.liquid files or “Custom Liquid” blocks/sections#shopify-section-image-banner-JHGkjbfd) to isolate rules and increase specificity without needing !importantThe issue remains unresolved pending the user’s implementation of the suggested approach.
I am having problems in using CSS on my image banner!!
Everything I try to modify does not work.
Can you please hel me in solving it?
mohwhi
Liquid code is not processed inside .css files.
/* Imposta l'altezza del banner al 120% della finestra (puoi regolare a tuo piacere) */
#Banner-{{ section.id }} {
height: 120vh !important; /* Aumenta l'altezza del banner (120% dello schermo) */
And obviously, inside .css file there is no section.
Stuff like this can only work inside .liquid file or “Custom Liquid” blocks/sections…
Need to come up with a different selector.
Note that if you put code inside “Custom CSS” setting of the section, the system will automatically prepend section id selector, like
p { color: white; }
becomes
#shopify-section-image-banner-JHGkjbfd p { color: white; }
This way the system isolates these rules to this section only and also raises their importance (without using !important)