0

how can I apply a css-class, so that in that div, just the digits will have a specific color? I am using wicket to generate the content of the div.

here is my code for ex:

<div class="coloredDigitsClass">
    <div wicket:id="axMax125At10V"></div>
</div>

and the generated text will look like this "Roni, Type @ 4.5V, 90°C"

but it could be something like this as well: "Roni, Maxi/125°C @ 10V"

I want that just "4.5" and "90" in the first example to be colored in red. and in the 2nd example, "125" and "10".

ZelelB
  • 1,836
  • 7
  • 45
  • 71
  • If you want to solve this with Wicket, you can intercept the `onComponentTagBody` method and iterate the strings characters to build up a new string with digits replaced with `SOME_DIGIT` – Imperative Jul 16 '15 at 07:13

1 Answers1

0

A solution with CSS would be using the unicode-range descriptor, as was also suggested in this answer. Alternatively use jQuery as was suggested in this answer.

Community
  • 1
  • 1
FWDekker
  • 1,823
  • 2
  • 20
  • 26