如何定义一个绝对的整体文本样式类? [英] How to define an absolute overall text style class ?

查看:98
本文介绍了如何定义一个绝对的整体文本样式类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想定义一个文本样式类,每当我引用它时它都是活动的。

以下不起作用

CSS中的


bluetext {颜色:蓝色; FONT-SIZE:16px的; HTML格式的


.....

< TABLE>< TR>< TD>

< class = bluetext>这应该显示为蓝色< / class>

< / TD>

< TD这应该出现在某些其他风格< / TD>

....


即使我将它封装在一个< Ptag中它也不起作用


.....

< TABLE>< TR>< TD>

< P class = bluetext>这应该以蓝色显示< / P>

< / TD>

< TD这应该以其他一些风格出现< / TD>

。 ...


为什么?


还有其他的东西吗?


Keith

解决方案

2007-05-09,Keith Clark< k。***** @ lucent.comwrote:


我想定义一个文本样式类,每当我引用它时它都是活动的。

以下不起作用


in CSS:

bluetext {COLOR:blue; FONT-SIZE:16px的; }



你需要一个。在蓝图之前。目前,选择蓝图

_element_(HTML中不存在),而不是蓝图类。

HTML中的


....
< TABLE>< TR>< TD>
< class = bluetext>这应该出现在蓝色< / class>



没有你使用的是一个类元素,它在HTML中也不存在

,并且不会匹配你的选择器。


>< / TD>
< TDThis应该以其他一些风格出现< / TD>

...


即使我将它封装在< Ptag中它也不起作用


....
< TABLE>< TR>< TD>
< P class = bluetext>这应该出现在蓝色< / P>



这更像是它。


>< / TD>
< TDThis应该出现在其他一些风格中< / TD>

...


为什么?



你只是没有正确的基本语法!


2007年5月9日08:59 :29 GMT, k.*****@lucent.com (Keith Clark)写道:
< blockquote class =post_quotes>
我想定义一个文本样式类,每当我引用它时它都是活动的。

以下不起作用

$ CSS中的b $ b:

bluetext {COLOR:blue; FONT-SIZE:16px的; }



或许

.bluetext {颜色:蓝色; FONT-SIZE:16px的; }

对你有用。


-

史蒂文


< blockquote>" Keith Clark" < k。***** @ lucent.comwrote in message

news:46 ********************** @ newsspool2 .arcor-online.net ...


>我想定义一个文本样式类,每当我引用它时它都是活动的。

以下不起作用

CSS中的


bluetext {COLOR:blue; FONT-SIZE:16px的; }



..bluetext ...


< class = bluetext>这应该出现在蓝色< ; /类>



然而不好意思。如果你想改变颜色怎么办?然后你会

有:


..bluetext {color:red; ...


最好叫它.importantcell


-

理查德。

I want to define a text style class which is active whenever I refer to it.
The following does not work

in CSS:
bluetext { COLOR: blue; FONT-SIZE:16px; }

in HTML:
.....
<TABLE><TR><TD>
<class=bluetext>this should appear in blue</class>
</TD>
<TDThis should appear in some other style</TD>
....

Even when I encapsulate it in a <Ptag it doesn''t work

.....
<TABLE><TR><TD>
<P class=bluetext>this should appear in blue</P>
</TD>
<TDThis should appear in some other style</TD>
....

Why ?

Is there another wway ?

Keith

解决方案

On 2007-05-09, Keith Clark <k.*****@lucent.comwrote:

I want to define a text style class which is active whenever I refer to it.
The following does not work

in CSS:
bluetext { COLOR: blue; FONT-SIZE:16px; }

You need a . before bluetext. Currently that selects the bluetext
_element_ (which doesn''t exist in HTML), not the bluetext class.

in HTML:
....
<TABLE><TR><TD>
<class=bluetext>this should appear in blue</class>

No there you''re using a class element, which doesn''t exist in HTML
either, and wouldn''t match your selector either.

></TD>
<TDThis should appear in some other style</TD>
...

Even when I encapsulate it in a <Ptag it doesn''t work

....
<TABLE><TR><TD>
<P class=bluetext>this should appear in blue</P>

That''s more like it.

></TD>
<TDThis should appear in some other style</TD>
...

Why ?

You''re just not getting the basic syntax right!


On 09 May 2007 08:59:29 GMT, k.*****@lucent.com (Keith Clark) wrote:

I want to define a text style class which is active whenever I refer to it.
The following does not work

in CSS:
bluetext { COLOR: blue; FONT-SIZE:16px; }

Perhaps
.bluetext { COLOR: blue; FONT-SIZE:16px; }
will work for you.

--
Steven


"Keith Clark" <k.*****@lucent.comwrote in message
news:46**********************@newsspool2.arcor-online.net...

>I want to define a text style class which is active whenever I refer to it.
The following does not work

in CSS:
bluetext { COLOR: blue; FONT-SIZE:16px; }

..bluetext ...

<class=bluetext>this should appear in blue</class>

Bad idea however. What if you want to change the colour. Then you would
have:

..bluetext{color: red; ...

Better to call it .importantcell

--
Richard.


这篇关于如何定义一个绝对的整体文本样式类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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