Why doesn’t my CSS code apply when I insert it into the page HTML header or in the ‘script/meta tags in header’ settings? It only actually works with an HTML element on the page.
Here’s a simple example:
I added a ‘box’ class to a Bubble element using the Classify plugin, then I inserted the CSS code into an HTML element on the page and it worked. BUT, when I inserted this code into the page HTML header and removed the HTML element, my style did not apply to the element with the ‘box’ class. Please tell me why it is so.
probably it’s a problem of name clashing, some other code declares a class box and it’s executed after the html head but before the code in the html element so it can override your declaration depending on where you put it.
I suggest using a more specific name, ideally with a prefix to scope your classes.
I need to apply css style to many pages. Sure I can create an HTML element for each page, but I think it would be better to insert a snippet in the meta tags settings. This way, the pages won’t have to load the same css every time.