Custom CSS hover in Categories

AI-generated summary

In a support discussion titled ‘Custom CSS hover in Categories,’ AndreSpecker asked how to apply a custom a:hover style within category boxes, specifically wanting to change link color on hover. Their initial attempt using [data-category-id="7"] { .category-box { background: #0088CC10; } a:hover { color: #D52133 !important; } } didn’t work. They also shared working CSS for background colors per category ID. Canapin requested a link to the category page to better understand the HTML structure. AndreSpecker provided the URL: https://alertamaximo.com/categories. Canapin then supplied a working SCSS example targeting the badge wrapper inside the category box: .category-box[data-category-id="1"] { background: #0088CC10; .badge-wrapper.bullet:hover span.badge-category { color: red; } }. AndreSpecker confirmed the solution worked perfectly and thanked Canapin. The issue was resolved by correctly targeting the nested elements within the category box rather than using a generic a:hover selector.

How i can add a custom a:hover ??? I change the background, but I have no idea how the structure is to add a: hover

i try this, but doesn’t work

[data-category-id=“7”] {
.category-box { background: #0088CC10; }
a:hover { color: #D52133 !important; }
}

For background i use this

.category-box[data-category-id="1"] { background: #0088CC10; }
.category-box[data-category-id="7"] { background: #231F2010; }
.category-box[data-category-id="8"] { background: #12a89d10; }
.category-box[data-category-id="5"] { background: #bf1e2e10; }
.category-box[data-category-id="9"] { background: #25AAE210; }
.category-box[data-category-id="6"] { background: #F7941D10; }
.category-box[data-category-id="10"] { background: #B3B5B410; }
.category-box[data-category-id="2"] { background: #80828110; }
.category-box[data-category-id="3"] { background: #E4573510; }
.category-box[data-category-id="4"] { background: #A461EF10; }

I don’t know what your HTML looks like, can you provide a link to your category page?

https://alertamaximo.com/categories

Example for category 1:

.category-box[data-category-id="1"] {
    background: #0088CC10;
    .badge-wrapper.bullet:hover span.badge-category {
      color: red;
    }
  }
}

worked perfectly, thank you very much