English 中文(简体)
CSS 遗产继承行为
原标题:Correct CSS inheritance behavior for properties that aren t inherited?

因此,我们说,我们拥有一个没有因违约而继承的财产。 我们称之为“oo”,其违约价值是“黑”。 之后,我们又做了以下工作:

<div id="div1" style="foo: red;">
 <div id="div2">
   <div id="div3" style="foo: inherit;">
   </div>
 </div>
</div>

由于这一财产没有因违约而继承,因此,你认为,在四舍五入中,“foo”必须是“黑”的,因为没有违约继承。

但是,......在div3中,“foo”的价值是否应当继承其父母的“黑人”,即did 而不是继承oo,或者它是否继承了“被”的祖父母,因为其父母没有具体规定oo?

我需要知道,因为我试图具体执行某种事情。

最佳回答

它继承其父母(不是祖父母)计算价值:

问题回答

div3将继承四舍五入,因此其oo将是黑体。 继承权来自父母。





相关问题
Subclass check, is operator or enum check

A couple of friends was discussing the use of inheritance and how to check if a subclass is of a specific type and we decided to post it here on Stack. The debate was about if you should implement a ...

C++ Class Inheritance problem

Hi I have two classes, one called Instruction, one called LDI which inherits from instruction class. class Instruction{ protected: string name; int value; public: Instruction(string ...

Overloading a method in a subclass in C++

Suppose I have some code like this: class Base { public: virtual int Foo(int) = 0; }; class Derived : public Base { public: int Foo(int); virtual double Foo(double) = 0; }; ...

Embedding instead of inheritance in Go

What is your opinion of this design decision? What advantages does it have and what disadvantages? Links: Embedding description

Extending Flex FileReference class to contain another property

I want to extend the FileReference class of Flex to contain a custom property. I want to do this because AS3 doesn t let me pass arguments to functions through event listeners, which makes me feel sad,...

Interface Inheritance in C++

I have the following class structure: class InterfaceA { virtual void methodA =0; } class ClassA : public InterfaceA { void methodA(); } class InterfaceB : public InterfaceA { virtual ...

热门标签