Is that what you had in mind?
<label class="required">Name:</label>
<input type="text">
<style>
.required:after {
content:" *";
color: red;
}
</style>
.required:after {
content:" *";
color: red;
}
<label class="required">Name:</label>
<input type="text">
See https://developer.mozilla.org/en-US/docs/Web/CSS/pseudo-elements