How to change CSS margin of a string value if value is larger then 99 inside a span tag

I want to change CSS margin of a string when it’s value is > then 99 inside a tag? how to achieve this?

.total_quantity {
  position         : absolute;
  z-index          : 1;
  background-color : transparent;
  font-family      : cute-font;
  font-size        : 40px;
  animation        : neonAnim 2s alternate-reverse infinite;
  color            : #FF00F0;
/* Default Value */
  margin-right     : 2px;
/* I want to change the CSS margin to the below value when it's > 99 */
  margin-right     : 20px;
  }
<span class="total_quantity">99</span>

2 thoughts on “How to change CSS margin of a string value if value is larger then 99 inside a span tag”

Leave a Comment