请问代码是否正确

来源:2-7 编程练习

mogu54mogu

2019-07-11 17:48:36

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>习题</title>
    <style>
    </style>
</head>

<body>
    <ul>
        <li>1</li>
        <li>2</li>
        <li>3</li>
        <li>4</li>
    </ul>
    <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script>
    <script>
        $(document).ready(function(){
           $('li').mouseenter(function(){
                $(this).css({
                    'font-size':'2em',
                    'color':'red'
                });
           }).mouseleave(function(){
                $(this).css({
                    'font-size':'1em',
                    'color':'black'
                });
           });
        });
    </script>
</body>

</html>


写回答

1回答

好帮手慕码

2019-07-11

同学你好!

代码效果实现的是可以的

如果帮助到了你 欢迎采纳 祝学习愉快~

0

0 学习 · 14456 问题

查看课程