Adding custom css on particular categories

Hi all,

I would like to add custom css on particular categories.

How do I access to particular categories in CSS and customise?

image

1 Like

Hi !

You can use CSS to target attribute, in your case: data-category-id.

But i think that attribute it wil change after you create/delete one categories.

tr[data-category-id="3"] {
    background-color: red;
}
2 Likes

Hi SSebastian,

Thanks for your reply! Do you happen to know how I can achieve in javascript? I would like to do implement in the script! Thanks for your reply again :slight_smile:

P.S

I have added the line below and it does not seem to work…
document.querySelectorAll(‘tr[data-category-id=“3”]’)[0].style.display = “none”;

Why you want to use JavaScript instead of CSS?

Don’t use JS if your task can be done only with CSS. It’s not logic.

1 Like