Before an element is attached to the DOM, it will not have any styling applied to it. This means that its computed-style will not be available until after it has been rendered:
Here is an example using HTML, CSS, and JavaScript:
<a href="#">Something</a>
CSS:
a {
color: purple;
}
JavaScript:
var body = document.getElementsByTagName('body')[0];
var a = document.createElement('a');
a.href = 'http://google.com/';
a.innerHTML = 'link to google';
console.log('color: ' + window.getComputedStyle(a,null).getPropertyValue('color'));
body.appendChild(a);
console.log('color: ' + window.getComputedStyle(a,null).getPropertyValue('color'));
JS Fiddle.
However, if you explicitly add styling to the element using JavaScript by modifying the 'style' attribute of the element, that styling information will be available immediately (though still not through getComputedStyle()):
var body = document.getElementsByTagName('body')[0];
var a = document.createElement('a');
a.href = 'http://google.com/';
a.innerHTML = 'link to google';
a.style.color = 'green';
console.log('color: ' + a.style.color);
body.appendChild(a);
console.log('color: ' + a.style.color);
JS Fiddle.