<div data-red="1234">This is Div</div>
body{
  background: #1f1f1f;
  width: 80%;
  border: 1px dashed #ffffff;
  margin: auto;
  padding: 50px;
  color: #ffffff;
}

div{
  display: flex;
  justify-content: center;
}


/* Substring Attribute Selector*/
 div[data-red*="23"]{
    font-size: 20px;
    color: lightgreen;
 }

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.