<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<style>
body {
background-color: rgb(223, 223, 223);
}
.list {
margin-top: 50px;
margin-left: 50px;
background-color: rgb(29, 156, 29);
width: 150px;
height: 150px;
transition: 0.5s; /* 缩放动画特效时间*/
text-align: center;
color: white;
line-height: 140px;
overflow: hidden;
/* 默认隐藏 */
}
/* 鼠标移入,缩放 */
/*
scalex()水平方向缩放
scaley()垂直方向缩放
scale()双方向缩放
*/
.list:hover {
transform: scale(1.2); /* 以1为单位放大和缩小 */
}
.picture{
margin-top: 50px;
margin-left: 50px;
width: 550px;
height: 350px;
transition: 0.5s;
text-align: center;
color: white;
line-height: 340px;
background-color: rgb(233, 135, 135);
}
.img {
width: 100%;
height: 100%;
}
.picture:hover{
transform: scale(2);
/* 以1为单位放大和缩小 */
}
</style>
<body>
<div class="list"> 缩放动画效果 </div>
<div class="picture">
<img src="https://www.baidu.com/img/flexible/logo/pc/result.png">
</div>
</body>
</html>
【css】css中实现DIV动画缩放效果(示例)
原创
©著作权归作者所有:来自51CTO博客作者敦厚的曹操的原创作品,请联系作者获取转载授权,否则将追究法律责任

提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
有趣的CSS - 文字加载动画效果
用 css 实现多字符模拟加载动画效果。
css 加载动画 交互 ux 动效 -
有趣的css - 打字机动画效果
使用 css 实现好玩的单行打字机效果,和我一起看看吧。
动效设计 交互设计 ux/ui 打字机动画 -
CSS:实现闪烁效果动画
CSS动画实现闪烁效果
html 前端 -
cordova plugin 浏览器
cordova 是hybrid开发app的一个框架,通过js桥接原生api实现了js调用原生的一些功能;本打算学习下阿里的weex;可是一直打包不了,加上之前也用过cordova,打算使用cordova尝试一下;整合上vue这种开发界面的利器是不是更加爽呢?  
cordova plugin 浏览器 cordova vue webpack ViewUI