如何在CSS中完成多色文本/字体? [英] How is multi-color text/font done in CSS?

查看:454
本文介绍了如何在CSS中完成多色文本/字体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是CSS的新手,所以要善良。 :-)


我看过CSS的例子,但还没有看到。

怎样才能改变CSS中同一个单词中文本的颜色?例如,

,你怎么能用信息系统这个词呢?并制作信息部分

红色和系统部分蓝色?我不想在HTML中硬编码

这就是为什么我要用CSS来做这件事。谢谢!

I''m a newbie to CSS, so be kind. :-)

I have looked at examples of CSS and have not seen this yet. How can
you change the colors of the text in the same word in CSS? For example,
when how can you take the word "infosystems" and make the "info" part
red, and the "systems" part blue? I don''t want to have to hard-code
this in HTML which is why I''m looking to CSS to do this. Thanks!

推荐答案

eastcoastguyz于2007年1月18日写在

comp.infosystems。 www.authoring.stylesheets:
eastcoastguyz wrote on 18 jan 2007 in
comp.infosystems.www.authoring.stylesheets:

I 是CSS的新手,所以要善良。 :-)


我看过CSS的例子,但还没有看到。

怎样才能改变CSS中同一个单词中文本的颜色?例如,

,你怎么能用信息系统这个词呢?并制作信息部分

红色和系统部分蓝色?
I''m a newbie to CSS, so be kind. :-)

I have looked at examples of CSS and have not seen this yet. How can
you change the colors of the text in the same word in CSS? For example,
when how can you take the word "infosystems" and make the "info" part
red, and the "systems" part blue?



< span style =''color:red;''>

info< / span>< span style =' 'color:blue;''> systems< / span>

<span style=''color:red;''>
info</span><span style=''color:blue;''>systems</span>


我不想要硬编码
这是HTML中的
这就是为什么我要用CSS来做这件事。谢谢!
I don''t want to have to hard-code
this in HTML which is why I''m looking to CSS to do this. Thanks!



" hard-code" ?

CSS并不柔软!


-

Evertjan。

荷兰。

(请将x''es更改为我的电子邮件地址中的点数)

"hard-code" ?
CSS is no softy!

--
Evertjan.
The Netherlands.
(Please change the x''es to dots in my emailaddress)


2007年1月18日星期四,eastcoastguyz写道:
On Thu, 18 Jan 2007, eastcoastguyz wrote:

怎样才能改变CSS中同一个单词中文本的颜色?例如,

,你怎么能用信息系统这个词呢?并制作信息部分

红色和系统部分蓝色?
How can
you change the colors of the text in the same word in CSS? For example,
when how can you take the word "infosystems" and make the "info" part
red, and the "systems" part blue?



示例:
http://www.unics.uni-hannover.de/nht.../rainbow.html6

Example:
http://www.unics.uni-hannover.de/nht.../rainbow.html6




eastcoastguyz写道:

eastcoastguyz wrote:

例如,

什么时候你怎么能用信息系统这个词呢?并制作信息部分

红色和系统部分蓝色?
For example,
when how can you take the word "infosystems" and make the "info" part
red, and the "systems" part blue?



< style type =" text / css" >

..highlight {color:red; }

..lowlight {color:blue; }

< / style>


< p>

< span class =" highlight" > info< / span>< span class =" lowlight"


<style type="text/css" >
..highlight { color: red; }
..lowlight { color: blue; }
</style>

<p>
<span class="highlight" >info</span><span class="lowlight"


> systems< / span>
>systems</span>



< / p>

</p>


我不想要硬编码

这用HTML格式,这就是为什么我要用CSS来做这件事。
I don''t want to have to hard-code
this in HTML which is why I''m looking to CSS to do this.



硬编码适当抽象的类或id值到HTML中,然后

通过CSS附加特定样式。

如果您的课程合适,那么硬编码就不是问题



Hard-code suitably abstract class or id values into the HTML, then
attach the specific styles through CSS.
If your classes are appropriate, it''s not aproblem to have hard-coded
them


这篇关于如何在CSS中完成多色文本/字体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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