Allowing Users to change Font Size

Greetings, I’m designing an internet site . for older people and as a consequence require it to be user friendly. Thusly I want them youngster should be vary the font size to permit them to go through it better. I know sometimes it is done by transitioning stylesheets, but can any person tell me how to accomplish this, or direct me to your tutorial

Effectively, if you provide the area you need to change a identity, such as

PHP:


< div  id="divname"> div  text< /div>


Then, to be able to change it, believe do

PHP:


< script  type="text/javascript">

document. getElementById("divname"). style. fontSize  '14pt';

< /script>


hope that helps

Can’t they set it into their browsers

For those who have a declared font size in the stylesheet or website page, that would override anyone user’s settings.

Yet, they could check out View -> Copy Size, and modify it.

Of course, they could. This is certainly, again, a matter of you writing how do i serve your readers, and not the other way around.

Try a fixed font-size about the body tag, and have the sizes skin color other tags established to relative measurements (as in ems or %) with the body size to produce the sizes cascade decrease the document hardwood.

Then on the link:
< the href=" #" onclick=" setSize(3); " > bigger size< /a>

and from the. js:

Code:
function setSize(i)
var b = document. getElementByTagName(" body" );
switch(i)
case 1:
b. style. fontSize = '10px'; //small
crack;
case 2:
b. style. fontSize = '12pt'; //normal
crack;
case 3:
b. style. fontSize = '14pt'; //large
crack;
default:
setSize(2);

.

This entry was posted in Web Design and tagged , , , , , , , , , , , , , , , , , , . Bookmark the permalink.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *