Hi Everyone, f Comment

I am Michael. I blog about helpful tips, anything from technical (e.g. how to remove computer virus ) to hobbies (e.g. how to solve the rubik's cube ) to my favorite crafts like how to make an origami swan that may help you solve an issue you've long had or simply inspired you to enjoy life more!

Google has been a great friend to me for helping me find solutions to my problems, but it is not omnipotent. Quite often I just cannot find the solution regardless of how I tweak the search query. It is frustrating and disappointing.

When that happens it doesn't mean that the solution does not exist. It may mean that it exists but for some reason you cannot find it on Google or any other search engine.

To that end I try to make every one of my blogs search engine friendly so that you have the best chance of finding useful information. This is the purpose behind OneMinuteInfo!

Feel free to leave a comment in the comment box below each post!

Check below for my latest posts!

Oct 31, 2023

How To Use Javascript To Make HTML Body Font Bigger or Smaller?
Amazon How do you incrementally increase or decrease HTML body font size via Javascript, perhaps with two buttons, one for increasing and one for decreasing the font size?

Many tutorials teach you how to make the body font bigger or smaller, but not incrementally. You'd like to continually make the HTML font bigger by clicking some button multilpe times, which may be labled A+. Also, you'd like to continually make the HTML font smaller by clicking some button multilpe times, which may be labled A-.

My tutorial will teach you to gradually increase/decrease the font size with a click of a button.

Here's how. Let's assume you are using 'px' as the unit for your HTML body font via CSS.

Javascript Code to Increase Font Size

document.body.style.fontSize = parseInt(window.getComputedStyle(document.body, null).getPropertyValue('font-size'))+2+'px';

Javascript Code to Decrease Font Size

document.body.style.fontSize = parseInt(window.getComputedStyle(document.body, null).getPropertyValue('font-size'))-2+'px';

The code should be quite self explanatory. You can change the number "2" to any other number you want. If you use another unit for the font size attribute in CSS such as 'em', 'rem', and '%', change 'px' accordingly. You can even change 'document.body' to another HTML element.

Questions? Let me know!
Please leave a comment here!
One Minute Information - by Michael Wen
ADVERTISING WITH US - Direct your advertising requests to Michael