如何在css/html中以不同颜色打印每个字母 [英] How to print each letter in different color in css /html

查看:38
本文介绍了如何在css/html中以不同颜色打印每个字母的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在网页上打印google",即(我想用不同的颜色打印每个字母,但都在同一行)例如:G 为黄色,o 为蓝色,o 为红色,g 为橙色等

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.

注意:仅使用 CSS

推荐答案

像这样使用spans:

<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>

它们就像 ph1 等,但它们不会转到下一行.

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

另外,请注意 Google 的使用条款.

Also, be aware of Google’s usage terms.

这篇关于如何在css/html中以不同颜色打印每个字母的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆