Quote:
Originally Posted by BGarner
I would assume this is achieved by using multiple style sheets. In the CSS just change the font-size property and then save them as three different CSS files and link to them accordingly. That's how I would do it; I don't know if there is a better way...
|
You can also use javascript to increase font-size incrementally -- so the buttons mean "make the font larger/smaller".
I used to supply this feature, but decided it was unnecessary clutter. Text-resizing is best done by the browser, with controls that the user is familiar with.
The following code allows you to set minimum and maximum sizes, and choose which elements to apply resizing (you could even do it by class with some more code).
- Code: Select all
var font_size = 1;
var MAX = 8000;
var MIN = 0.8;
function adjust_text(num)
{
font_size += num;
if(font_size > MAX)
{
font_size = MAX;
}
if(font_size < MIN)
{
font_size = MIN;
}
// document.getElementsByTagName("body")[0].style.fontSize = font_size + "em"; // Use this for resizing all text on the page
document.getElementById("resize").style.fontSize = font_size + "em"; // Use this for resizing just one element
}
adjust_text(0);