

The biggest downside to my script (which I havent been able to overcome yet) is that every element on the site must include its own ‘style=”font-size: px ” ‘ tag in order to resize. +2 or -4) which I then used to manipulate each tag as I got to it. To get round this, I simply used a variable which held the current adjustment value (i.e.

I didnt want everything on the site to be the same font size). The problem I found was that I needed a javascript text resizer which allowed for varying text sizes across the site, and kept htem all in proportion to each other when they were resized (i.e. One example of this can be found at which is a housing association site which I built. I have built a few of these javascript resizers, usually adding something new to each revision. I'm sure you readers can think of some improvements so let's see some in the comments! This works flawlessly on at least IE, Firefox, Opera, and Safari (others not fully tested, please give feedback :) Here's a simple example of this all put together. Simplicity is generally better where possible. There are libraries out there that do this, but in many cases it is likely overkill. This can easily be implemented with a bit of JavaScript and some HTML to attach it to.

To learn more about Eric, click here.Ī lot of blogs and websites that have a wide range of users tend to have buttons or images that change the text size for easier readability. This text would appear one font size smaller than the text "This is a paragraph and".This post was authored by Eric Wendelin. In this XHTML 1.1 Document example, we have created a tag that encloses the text "smaller text goes here". If you created a new web page in XHTML 1.1, your tag might look like this: This text would appear one font size smaller than the text "This is a paragraph and". In this XHTML 1.0 Strict Document example, we have created a tag that encloses the text "smaller text goes here". If you created a new web page in XHTML 1.0 Strict, your tag might look like this:

In this XHTML 1.0 Transitional Document example, we have created a tag that encloses the text "smaller text goes here". This is a paragraph and smaller text goes here If you created a new web page in XHTML 1.0 Transitional, your tag might look like this:
