jquery对css样式的操作

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="jquery-1.11.1.js"></script>
    <script>
        $(function () {
            //css(json)方式
                                    $("div").css({"width":"100px","height":"100px","background":"red"});
            //css(属性,值)
$("div").css("background","green");
        })
    </script>
</head>
<body>
<div></div>
</body>
</html>
posted @ 2017-12-29 08:34  aniymx  阅读(113)  评论(0)    收藏  举报