-1

I'm trying to hide a specific div using a css code but it's not working

<div class="test" data-type="category">

whenever i try to use

.test{
display:none;
}

it hides the whole test div's, i need to be able to hide the category data-type.

Thanks

Ayman
  • 131
  • 1
  • 9

1 Answers1

1

You can specify any element with their attribute by using element[attribute=value] in you css.

In your example you can do something like this

.test[data-type="category"] {
    display: none;
}
<div class="test" data-type="category">
Some text.
</div>
Debsmita Paul
  • 1,442
  • 9
  • 22