Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to print each letter in different color in css /html [closed]

Tags:

html

css

I want to print "google" on a web page i.e(i want to print each letter in different color but all are in same line)For Example: G is in yellow, o is in blue, o is in red , g is in orange etc.

Note:using CSS only

like image 410
Tyrell Avatar asked Jul 08 '16 14:07

Tyrell


1 Answers

Use spans like this:

<p>
  <span style='color: blue'>G</span>
  <span style='color: red'>o</span>
  <span style='color: yellow'>o</span>
  <span style='color: blue'>g</span>
  <span style='color: green'>l</span>
  <span style='color: red'>e</span>
</p>

They are just like p, h1 and etc, but they don't go to the next line.

Also, be aware of Google’s usage terms.

like image 151
Cameron Avatar answered Oct 12 '22 23:10

Cameron