2-14 作业代码,请老师帮忙检查,谢谢

来源:2-14 编程练习

呜蜩的呀

2022-07-31 19:34:40

还有没有哪里要改进呢?

相关代码:

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        #myTest {
            width: 100px;
            height: 100px;
            text-align: center;
            line-height: 100px;
            background-color: #f43838;
            margin: auto;
            margin-top: 100px;
            color: #FFF;
            cursor: pointer;
            font-size: 20px;
            font-weight: bold;
            /*添加代码*/
            /* 为了保持代码的规范,建议加上变化前的原来属性 */
            border-radius: 0%;
            transform: scale(1);

            /* 设置过渡动画,在0.5s内完成变形 */
            transition: transform 0.5s linear 0s;
        }

        #myTest:hover {
            /*添加代码*/
            /* 设置触碰后的形状变化:缩放为原来的两倍,并变成正圆形,背景颜色变为绿色 */
            transform: scale(2);
            border-radius: 50%;
            background-color: #468847;
        }
    </style>
</head>

<body>
    <div id="myTest"> duang! </div>
</body>

</html>


写回答

1回答

imooc_慕慕

2022-08-01

同学你好,代码可以实现需求,很棒,祝学习愉快~

0

0 学习 · 17877 问题

查看课程