如何让字体的大小保持不变?

来源:3-3 编程练习

慕村7338132

2018-07-22 18:46:03

<!DOCTYPE html>

<html>

<head>

    <meta charset="UTF-8">

    <title>3-1作业</title>

    <style>

        div {

            font-size: 14px;

            font-weight: bold;

            line-height: 50px;

            position: fixed;

            top: 0;

            right: 0;

            bottom: 0;

            left: 0;

            width: 200px;

            height: 50px;

            margin: auto;

            cursor: pointer;

            text-align: center;

            background: #abcdef;

            transform:scale(1) rotate(0deg);

            transition:transform 2s ease-in-out;

           

        }

        div:hover{

            transform:scale(2) rotate(360deg);

            transition:transform 2s ease-in-out 1s;

        }

    </style>

</head>

<body>

    <div>www.imooc.com</div>

</body>

</html>


写回答

1回答

好帮手慕夭夭

2018-07-23

经过测试 ,css代码可以如下修改 :

hover时改变宽高

http://img.mukewang.com/climg/5b5536000001028604400224.jpg

div样式设置如下

http://img.mukewang.com/climg/5b5536190001c09703890099.jpg

完善一下哦 , 望采纳 , 祝学习愉快 !

0

0 学习 · 5760 问题

查看课程