I have tooltips enabled on my website but I want to hide the tooltip pop-ups specifically displaying over video embeds. I have tried inspecting the webpage and got this following code that only appears when those elements are hovered over.
<div data-tippy-root id="tippy-8" style="pointer-events: none; z-index: 9999; visibility: visible; position: absolute; inset: auto auto 0px 0px; margin: 0px; transform: translate3d(712px, -688.8px, 0px);"> </div>
So I tried adding in these "fixes" but the random numbers attached to "#tippy-" change every time, and make it nearly impossible to target and toggle off its visibility for good. So how can I go about targeting every number possible attached to "#tippy-" to keep this element hidden?
#tippy-9, #tippy-8 {
display: none !important;}
#data-tippy-root {
display: none !important;
visibility: none !important;}
3
Answers
You can use attribute selectors in CSS to target elements with IDs that match a specific pattern.
If all the ID start with "tippy-" and end in a random number you can use something like
The
^
indicates that the selector must start with the designated value.Try: