开发者

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>


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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜