目前遇到一个问题,请大神指点:dasdig.css中有个
.text_color{color: #f0ad4e;}
dasdig2.css中也有个
.text_color{color: ;},
现在有个dasdig.html,里面先加载的dasdig.css,然后再加载dasdig2.css,如下:
<link href="__STATIC__/dasdig.css" rel="stylesheet">
<link href="__STATIC__/dasdig2.css" rel="stylesheet">
我在dasdig2中怎么设置.text_color
的颜色属性,能实现将颜色属性消失,即不再出现任何颜色属性?
1. The name of CSS is Cascading Style Sheet, which has the characteristic that properties defined later overwrite previously defined properties.
2.
颜色属性消失是什么意思
, are you trying to make color invisible?Or do you want
.text_color的颜色
to inherit the color attributes of its parent?Or make its color transparent (the element will not be visible)?
The former can only be achieved through javascript code, such as http://www.w3school.com.cn/jquery/jquery_ref_attributes.asp or http://www.w3school.com.cn/jsref/dom_obj_attributes.asp;
The latter can be inherited from the parent by setting
color:inherit
Properties,To achieve the transparency effect, you can use the
color:transparent
attributeIf you no longer need to display the text in the element, you can hide it or use negative indentation; and in the later introduction, set the text color to a transparent color
color: transparent;
, as in the following example:http://jsfiddle.net/65PLY/1/
Inherit
Transparent
Flush out (#box has a p id of text_color, it can be flushed out no matter where it is)