Is it possible to have each word in a H1 a random colour and that if you refresh the page these will then be randomised again?
I have 5 set colours I want to use. How would I code this ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, that’s possible :
The main idea is to split the content of each h1 into words and replace the words by embedding them in
<span>as you can’t style a word but only an element.Demonstration