Forum Moderators: phranque

Message Too Old, No Replies

text size adjustment

         

kumarsena

7:44 pm on Sep 21, 2004 (gmt 0)

10+ Year Member



i have noticed that more and more sites are providing the visitor with the option to change the font size to their pleasing. one site i notices checking the source used three dieeferetn style sheets for the sizes (it had 4 options) and some javascript. now i was wondering...anyone know how this is done? and also is there a way of doing this only using css, or maybe with php...?

thanks for any reply..

im off to sleep now.
kumar

Max_K

10:27 pm on Sep 21, 2004 (gmt 0)

10+ Year Member



Try something like this:

<html>
<head>
<title>Dynamic Font Size Adjustment Test</title>
<style>
body {
background-color:#000000;
color:#BBBBBB;
}

.special {
text-indent:1em;
color:#DD0000;
font-weight:bold;
}

</style>

<script language="JavaScript">
function adjust_font_sz(sz) {
document.body.style.fontSize = sz;
}
</script>
</head>
<body>
<p>Paragraph One</p>
<p>Paragraph Two</p>
<p>Paragraph Three</p>
<p class="special">Font Size:</p>
<p class="special">{
<span onclick="adjust_font_sz('smaller');" style="font-size:smaller;"><u>1</u></span>
¦
<span onclick="adjust_font_sz('');" style="font-size:;"><u>2</u></span>
¦
<span onclick="adjust_font_sz('larger');" style="font-size:larger;"><u>3</u></span>
}</p>
</body>
</html>

kumarsena

7:33 am on Sep 22, 2004 (gmt 0)

10+ Year Member



tnx maxk

its still too early too figure out the code, althoiugh testament is already banging in my ear...he he

will try it later today...

thanks again.
kumar

edit_g

7:44 am on Sep 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<post removed, WebmasterWorld doesn't seem to like that site>