Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Target all instances of a word with CSS

Hi folks! So, I know how to target individual letters in Twine, but I'm currently trying to target all instances of a particular word in a big story with a particular CSS effect. Is there a combination of CSS selectors using the .char selector that I can use to, say, target the word "feather"? Or is it best to try to use jQuery in a custom script? (I have no real experience with custom scripts and not much with jQuery, which is why I'm hoping for an easier option...)

Comments

  • This isn't quite possible... at the most, you can style the final letter "r" of the word "feather", the final letter "e" of the word "feathe", and so forth. Obviously this isn't feasible, so, well, something else must be done.
  • OK, thank you. I'll see if I can do something with span classes - am I right in thinking I can manually wrap the word so it looks like
    <span class="feather">feather</span>
    in passages, and then target through CSS that way?
  • [quote author=mazaru]am I right in thinking I can manually wrap the word so it looks like
    <span class="feather">feather</span>

    Yes.
Sign In or Register to comment.