PennController for IBEX › Forums › Support › How to make keypress add a CSS class to text › Reply To: How to make keypress add a CSS class to text
May 30, 2023 at 10:13 am
#10638
![](https://www.pcibex.net/wp-content/uploads/2018/10/IMG_8365-e1540835663655-150x150.jpg)
Keymaster
Hi Larissa,
Instead of using .css
you could indeed add the rules in the CSS file under .PennController-words {
and the result would be equivalent
The current rule in the CSS file targets .PennController-words .word
, that is, elements with the class word
that are children of elements with the class .PennController-words
. We make sure to add the class word
to each span
inside the Text element (see the map
function) so that selector does target each word individually, as intended
Jeremy