Can't get css property of 'content' in Safari 4 -


I find the hardest time that Firefox 3.1 gives the value of 'content' on a test element, whereas Safari 4 will not be.

My sample page is set to:

  & lt; Style & gt; #asd {content: 'test'; } & Lt; / Style & gt; & Lt; Div id = "asd" & gt; Bleh & lt; / Div & gt;  

and my JS is using getComputedStyle, it works for other properties like "background color", but not for "content":

 < Code> if (window.getComputedStyle) {var thestyle = window.getComputedStyle (document.getElementById ('asd'), ''); Warning (thestyle.getPropertyValue ('content')); }  

Safari is more restrictive about pseudo-element selectors: First and After:? I tested with it: and after that also fails, FF succeeds in returning data.

Safari only supports the content of the property: first and foremost: after pseudo elements.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -