Reputation: 5816
When exactly is inline CSS like this applied?
<p style="background: blue; color: white;">A new background and
font color with inline CSS</p>
onDomReady, onDomLoaded, instantly...?
Upvotes: 0
Views: 116
Reputation: 39669
It's before onDomReady or onDomLoaded. Those style attributes will be set on the DOM node as the element is parsed, along with all of the other inline attributes. If you were to inspect the element in JavaScript in the very next line (w/out waiting for a load/ready event), you would see that the style properties are already set.
Upvotes: 1
Reputation: 15802
It's applied as soon as the DOM element is created, before both DomReady and DomLoaded.
See http://jsfiddle.net/HZXXp/
Upvotes: 1
Reputation: 13145
When DOM parse your HTML file.It first parse your element then parse inline css. I think all browser follow this technique.
Upvotes: 0