0

I have this CSS rule: * { font:normal 12px puertoHelve,tahoma; }

Then I have divs like these (the children divs are created automatically):

<div class="asUserStyle" style="font-weight:bold;text-align:right;font-family:times new roman;font-size:16px;color:#000000;">
    test0
    <div>test1</div>
    <div>test2</div>
</div>

Now only test0 has the style applied to it but not the other divs; they have the previous rule.

Any ideas in CSS? If not, jQuery maybe..?

4

1 回答 1

0

http://jsfiddle.net/R7umu/2/

.asUserStyle div {
    //your other styles
}

编辑:

http://jsfiddle.net/R7umu/3/

所以 div 必须继承所有定义的样式.asUserStyle

.asUserStyle div {
    margin: inherit;
    color: inherit;
    .....
}
于 2013-08-11T13:54:36.633 回答