你能这样做吗? (亚类) [英] can u do this? (sub-classes)

查看:76
本文介绍了你能这样做吗? (亚类)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直想知道你是否可以这样做......


让我们说我定义了一个类:

..myClass {font-family:verdana,sans-serif;字体大小:11像素;颜色:#006699;

文字装饰:下划线}


然后我想定义这个的SUB-CLASS ..即,我想要定义一个

新类就像这个,但是只有一个attr设置不同,而且我不想重复所有的attr'..所以怎么说


..subclass-of-class-class {color:#990000}


所以这个新的子类myClass除了

之外,还有上面所有的attr'。字体颜色..


你可以这样做吗?谢谢...... Frances

I''ve been wondering for a while whether you can do this...

let''s say I define a class thus:

..myClass {font-family:verdana,sans-serif; font-size:11px; color:#006699;
text-decoration:underline}

then I want to define a SUB-CLASS of this one.. i.e., I want to define a
new class just like this one but w/only one attr set differently, and I
don''t want to repeat all attr''s.. so how do I say

..subclass-of-above-class {color:#990000}

so this new sub-class of myClass has all attr''s of above class except
for diff. font color..

can u do this? thank you...... Frances

推荐答案

Frances Del Rio写道:
Frances Del Rio wrote:
我''我一直想知道你是否可以这样做......

让我说我这样定义了一个类:

.myClass {font-family:verdana,无衬线字体;字体大小:11像素;颜色:#006699;
文字装饰:下划线}

然后我想定义一个SUB-CLASS这个..即,我想定义一个
新类就像这个,但只有一个attr设置不同,我不想重复所有的attr'..所以我怎么说

.subclass-of -above-class {color:#990000}

所以这个myClass的新子类除了
之外,还有上面所有的attr'。字体颜色..

你可以这样做吗?谢谢...... Frances
I''ve been wondering for a while whether you can do this...

let''s say I define a class thus:

.myClass {font-family:verdana,sans-serif; font-size:11px; color:#006699;
text-decoration:underline}

then I want to define a SUB-CLASS of this one.. i.e., I want to define a
new class just like this one but w/only one attr set differently, and I
don''t want to repeat all attr''s.. so how do I say

.subclass-of-above-class {color:#990000}

so this new sub-class of myClass has all attr''s of above class except
for diff. font color..

can u do this? thank you...... Frances




..myClass,.subclass-of-class {

font-family: verdana,sans-serif;

字体大小:11px;颜色:#006699;

text-decoration:下划线;

}

..subclass-of-class {

颜色:#990000;

}


< p class =" myClass"> blue underlined 11px Verdana font< / p>

< p class =" subclass-of-class-quot;> red underlined 11px Verdana

font< / p>


-

Els http://locusmeus.com/

Sonhos vem。 Sonhos v?o。 Orestoébritfeito。

- Renato Russo -

现在播放:M?tleyCrüe - Feelgood博士



..myClass, .subclass-of-above-class{
font-family:verdana,sans-serif;
font-size:11px;color:#006699;
text-decoration:underline;
}
..subclass-of-above-class{
color:#990000;
}

<p class="myClass">blue underlined 11px Verdana font </p>
<p class="subclass-of-above-class">red underlined 11px Verdana
font</p>

--
Els http://locusmeus.com/
Sonhos vem. Sonhos v?o. O resto é imperfeito.
- Renato Russo -
Now playing: M?tley Crüe - Dr. Feelgood


Frances Del Rio写道:
Frances Del Rio wrote:
我想定义一个SUB-CLASS
I want to define a SUB-CLASS



http://dorward.me.uk/www/css/inheritance/


-

David Dorward< http://blog.dorward.me.uk/> < http://dorward.me.uk/>

主页是〜/ .bashrc的位置



http://dorward.me.uk/www/css/inheritance/

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is


Frances Del Rio:
Frances Del Rio:
我一直想知道你是否能做到这一点......
I''ve been wondering for a while whether you can do this...




你应该用那段时间做一个很少的研究。有一个

类似的主题< news:qg ******************************** @ 4ax.com>

开始时间不到两天(之前还有更多)。



You should have used that time to do a little research. There is a
similar thread <news:qg********************************@4ax.com > that
started less than two full days before yours (and many more before).


这篇关于你能这样做吗? (亚类)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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