It’s great that you found a solution. But I'm trying to explain what happened behind the scenes.
The way you use css is not a general agreement . This object comes with an additional stone. Check out this link fooobar.com/questions/184949 / .... With these gems you can design your css more DRY .
General convention
if you want to apply style to the next element h1
# Here "store" class is the parent element of "h1" <div class="store"> <h1> some text </h1> </div>
The following css method is required
#Here also "store" is written before "h1" .store h1 {
What happens in your case?
Perhaps you support files with a wise css controller. And suppose you have stores_controller . This is why the classes for your stores_controller enclosed in a .store {} block. how
.store { h3 {font-size: 120%;} }
So it’s clear that your h3 elements require a parent element that has a store class. And you do this by adding class="<%= controller.controller_name %>" with the body tag. Undoubtedly, the <body> is the parent for all of the following nodes. Now when you click stores_controller , it sets class="store" and your styles work.
The approach is truly DRY and recommended.
source share