tags:

views:

39

answers:

3

How do I use CSS to define a text input area where digits and non-digits are rendered with different formats (bold/italic/color)?

i.e. 345 dollar -> 345 dollar

Are there anything equivalent to Regular Expression Library fo regex for CSS?



Below are edited


I'm using the Seam framework, any alternatives to achieve this is also welcomed.

A: 

What you want isn't possible.

svinto
+1  A: 

As svinto already says, this is definitely not possible. Not even, as far as I can see, using an advanced CSS tool like LESS.

You will have to work around by putting the digit into a tag:

 <span>345</span> dollar

you could of course automate that in a scripting language using Regexes, but I would recommend formatting the output properly instead of relying on such "post-processing", which can break any time when the formatting changes, for example in a different language / locale.

Pekka
A: 

You can't accomplish this in CSS exclusively. You could use PHP or Javascript to tag content that matches your criteria and style those tags with CSS, however.

Johannes Gorset