Hanna
Hanna

Reputation: 10771

jQuery resizing with CSS. Why won't this work?

Is there any reason the following code has no effect on font size?

<html>
<head>
    <title>test</title>
</head>
<body>
Test
    <script type="text/javascript">
        jQuery('body').css({fontSize:'2em'});
    </script>
</body>
</html>

Thanks

Edit: I for got the simple link. This is why I can't have nice things.

<script type="text/javascript" src="jquery-1.4.2.min.js"></script>

Upvotes: 0

Views: 129

Answers (1)

0x60
0x60

Reputation: 1096

Yes, first try putting a proper DOCTYPE then add a link to jQuery, and finally try

<script type="text/javascript">
    $('body').css({'font-size','2em'});
</script>

==EXAMPLE==

<!DOCTYPE html>
<html>
<head>
    <title>test</title>
     <script src="http://code.jquery.com/jquery-latest.min.js"></script>
</head>
<body>
Test
    <script type="text/javascript">
        $('body').css({'font-size','2em'});
    </script>
</body>
</html>

Upvotes: 1

Related Questions