скорее всего ты всё неправильно применяешь...
так, вот тебе 100% работающий вариант
Код:
<html>
<head>
<script language="JavaScript" type="text/javascript">
function change_style() {
if(screen.width==800) {
document.all.body.style.fontSize="10px"
} if(screen.width==1024) {
document.body.style.fontSize="50px"
}
}
</script>
</head>
<body onload="change_style();">
adfasdfasdfasdfasdfasdfasdfasdfasdf
</body>
</html>