<div class="fire" rating="10"></div>
.fire {
border: 1px solid red;
width: 100px;
height: 100px;
}
.fire::before {
content: attr(rating);
}
Note: The attr() function can be used with any CSS property, but support for properties other than content is experimental, and support for the type-or-unit parameter is sparse.