cartman cartman - 5 months ago 10
CSS Question

Change color conditionally Css

I'm using a third party component on my page, It has a class

dialog_RechatDialog0D55B000000P6Mv
where the Id changes for each post. how do I change color is
css
if the class contains
"dialog_RechatDialog"
, is that possible?
Any help is much appreciated.

Thanks!

Answer

This works, assuming your dom element is a div .

div[class^='dialog_RechatDialog'] {
    color: yellow;  
}

All (div) with a class that starts (^) with string "diablo_RechatDialog"