Question:
Ok so I am working on a Random Pokémon Generator and every time the user clicks the generate button it picks a random number between 1-905(Number of Pokémon in National Dex). I am able to show the image, name/id, and typing of the Pokémon that is generated. What im stuck on is how to change the color of the background of the container/class that the Pokémon is displayed in based on the typing of said Pokémon. Say the Pokémon’s typing is grass I would want the background to be a green color. I really don’t know where to start to even do this.I am using PokeApi
Answer:
1.Create a typeCss on object 2.Make css styles for all typeIf you have better answer, please add a comment about this, thank you!