Class name active/activated placement

Your terminology is confusing. I don’t know whether you understand the issue but are explaining it poorly, or whether you are still confused, so let me try to explain again.

You are referring to one div as being “above” another when that div is actually the parent of the other. The opening tag of the first div may be above the second, but the closing tag comes after it.

It is very important that you understand the difference between adjacent and nested divs (and other elements), in order to target them correctly with CSS.

You don’t need JavaScript to follow @Ray.H’s advice and try playing with some selectors. The fact that in your audio code one of the classes is being injected by JS is simply a red herring here.

Use my two examples, add a bit of text or an image as content, and then play about with the CSS rules and see how different rules affect the two different constructions.

I believe @Paul_Wilkins pointed out some time ago the potential for confusion over your choice of class name. Did you not change it elsewhere to “activated”, for this very reason? (Your chosen class name is not a part of JS, so Googling for it is unlikely to get you very far.)

1 Like