CSS attribute selector for existing but non-empty attributes June 25, 2023 by Tarik try this <style> [Data-Attribute]:not([Data-Attribute=""]) { background-color: Red; } </style>