0

So I have this piece of code showing the price, I want to hide it. I can display: none; on the price tag but then it is not showing anywhere, in the cart etc.

So I need to display none on the tag rnb_price_unit_number but I can't go through and do that for every item.

Is there a way to select all of the tags beginning with rnb_price_unit_ ? I thought rnb_price_unit_ * {display:none;} might work but it isn't.

Thanksimage of inspect for better view

1 Answers1

1

Yes you can do this using the CSS [attribute^=value] Selector

It would look something like this:

span[class^="amount rnb_price_unit_"] {
  background: #ffff00;
}
<span class="amount rnb_price_unit_30">from
  <span>something</span>
</span>
<span class="amount rnb_price_unit_40">from
  <span>something</span>
</span>

Further details about this selector can be found here: https://www.w3schools.com/cssref/sel_attr_begin.asp

Ramon de Vries
  • 1,312
  • 7
  • 20