Changing the colour of individual words

This is my code so far for the technical documentation challenge:

I have changed some words so that they are red using the span tag and CSS. I’d like to change other words to other colours, without changing the whole element. How do I go about this? For example if I want multiple words to be yellow and multiple words to be blue. I could use inline styling, but surely there is a more efficient method?

I assumed this would be straightforward but I’m not sure having looked it up. :thinking: Help is greatly appreciated! :slightly_smiling_face:

I believe you can only change manually the way you did with plain html and css, at most by assigning ids and classes to each element you planned to colorize. If you want to do it dynamically, you have to use more than plain html and css, anything that can manipulate DOM and do looping perhaps (at least plain javascript, or with its libraries). You’ll learn about it in the javascript certification and the one after it in the FCC curriculum (jQuery, SASS, etc.) You can go down the rabbit hole now, or just refactor it later on after the third certification…

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.