PDA

View Full Version : what programming language should i use


kaede
09-12-2002, 12:30 PM
my project required me to have a function that allow user to change the font size. That mean when user click on the "large" button the webpage will change the font of the webpage to large font. Any ideas which programming language should i use ... ?

sleddog
09-12-2002, 05:53 PM
Well, all the major browsers have this functionality built-in. For it to work correctly it is important that you specify relative font sizes, rather than absolute font sizes, in your web pages.

How to do it by having the user click a button the webpage? Hmmmm...

You could do it pretty easily with PHP I think:

1. prepare two style sheets: "small.css" and big.css";
2. put two buttons on the page: "Big Fonts", "Small Fonts" that pass a variable with a URL, e.g., "mypage.php?fontsize=big";
3. In the page encoding do something like this in the document HEAD section:

<?
if ($fontsize == "big") {
?>
<link rel="stylesheet" type="text/css" href="big.css">
<?
}
else {
?>
<link rel="stylesheet" type="text/css" href="small.css">
<?
}
?>

kaede
09-13-2002, 07:49 AM
thank ..