When you surf with your browser, you can increase or decrease the font dimension by pressing CTRL + + or CTRL + -.
Is there a way to simulate this operation by code (like javascript)?
I have to put a couple of button on my site to increase or decrease the size but to make it, I have to change dynamically a lot of font-size properties (BODY, INPUT, OPTIONS etc…)
Don’t do this. Browser zoom is a feature that:
What you really want to do is:
emor%) everywhere,document.body.style.fontSizeto modify your base size (which other elements willuse as their base size).
Specify the
body‘s font size in relative units too – In this way you can also respect the user’s system settings (which every decent website should do).There’s plenty of resources on CSS font scaling around. Here’s one:
http://kyleschaeffer.com/best-practices/css-font-size-em-vs-px-vs-pt-vs/