jquery .css('text-decoration') doesn't work from parents -
I have to get the essential CSS property of the element (the property can be inherited from her parents) < P> Standart Jquery .css () can do this.
I have such an HTML:
& Lt; Span id = "something" & gt; Our element & lt; / Span & gt; & Lt; Br> Some text & lt; / Div & gt; & Lt; Div id = "result" & gt; & Lt; / Div & gt; CSS: #some {font-weight: bold; } # Containers {text-decoration: underline; Color: RGB (0,255,0); Font-size: 32px; } and jQuery code:
$ (function () {var decor = $ ("#some") .css ('text-decoration' ) Weight Weight = $ ("#Additional"). CSS ('font-weight'); var color = $ ("#some"). CSS ('color'); var size = $ ("#some") Css ('font-size'); var result = "
Our object's own property: Font-weight: "+ weight +" <<< result <= & gt; hereditary property: & lt; / b & gt; & lt; br & gt; ; & Lt; br & gt; Results; + "Color:" + Color + "& lt; br> Font Size:" + size + "& lt; br & gt; Text-decoration : "+ Decoration; $ (" # result "). Html (results);}); All properties are displayed but text-decoration - no, but why?
Text-decoration is defined Inherited: No inside the CSS-specification < / P> See:
So everything really works fine :)
Comments
Post a Comment