本文介绍了更改CSS属性与jQuery的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
今天,我被一个非常简单的方法来改变使用jQuery元素的字体大小
。
它看起来非常类似于以下内容:
<脚本类型=文/ JavaScript的>
jQuery的(document.body的)({字体大小:5em的;});
< / SCRIPT>
这显然是行不通的,但我不知道缺少了什么?我还记得它是code的只有一行。
请注意:我曾尝试的jQuery(document.body的)的.css({字体大小:5em的;});
为好,但没有成功。
感谢。
解决方案
的jQuery(身体),CSS({字体:'5em的'});
Today I was shown a really simple way to change the font-size
of an element using jQuery.It looked very similar to the following:
<script type="text/javascript">
jQuery(document.body) ({font-size:5em;});
</script>
This obviously doesn't work, but I was wondering what's missing? I remember it being just one line of code.
Note: I have tried jQuery(document.body).css({font-size:5em;});
as well, without success.
Thanks.
解决方案
jQuery('body').css({fontSize:'5em'});
这篇关于更改CSS属性与jQuery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!