Reputation: 4959
After setting document.body.style.fontSize to a certain size using an window.onload function, all elements under body have the same size, even thought I have specified in their CSS class that their font-size should be 40% of their parent element.
What could be the reason?
Upvotes: 1
Views: 932
Reputation: 6958
The JavaScript modification comes after the CSS has been loaded. So all elements in your body are impacted. You should apply your modification to just the bunch of elements you want to modify.
Upvotes: 4