S
S
Sergey Romanov2015-01-01 12:00:04
JavaScript
Sergey Romanov, 2015-01-01 12:00:04

Why mystique in window.getComputedStyle()?

I can't understand why this is happening. My code is simple.

var styles = window.getComputedStyle(element[0], null);

console.log(styles);
console.log(styles['fontSize']);

And this code will display in the console
{
   'background': '0',
   'fontSize': '15px',
   'etc': '...'
}

11px

why? After all, it had just been 15 and it became 11. How so?
Forgot to mention. It's in the Angular directive. Maybe it matters.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question