FCC---Use the CSS Transform scale Property to Scale an Element on Hover
The transform
property has a variety of functions that let you scale, move, rotate, skew, etc., your elements.
When used with pseudo-classes such as :hover
that specify a certain state of an element, the transform
property can easily add interactivity to your elements.
Here's an example to scale the paragraph elements to 2.1 times their original size when a user hovers over them:
p:hover {
transform: scale(2.1);
}
Note: Applying a transform to a div
element will also affect any child elements contained in the div.
练习题:
Add a CSS rule for the hover
state of the div
and use the transform
property to scale the div
element to 1.1 times its original size when a user hovers over it.
练习代码:
<style>
div {
width: %;
height: 100px;
margin: 50px auto;
background: linear-gradient(
53deg,
#ccfffc,
#ffcccf
);
}
div:hover {
transform: scale(1.1);
} </style> <div></div>
练习效果:
鼠标移动过去,放大1.1倍,挺好玩的
FCC---Use the CSS Transform scale Property to Scale an Element on Hover的更多相关文章
- 关于CSS:transform、transition的运用
这3个属性是CSS3新增的属性,功能极其强大,能完成许多以往JS才能完成的页面动态效果,而且运行效率非常高,考虑到浏览器兼容性问题,应在3个属性前面加上各浏览器的前缀.以下思维导图介绍了3个属性的各属 ...
- CSS Transform完全指南 #flight.Archives007
Title/ CSS Transform完全指南 #flight.Archives007 序: 第7天了! 终身学习, 坚持创作, 为生活埋下微小的信仰. 我是忘我思考,共同进步! 简介: 一篇最简约 ...
- CSS Transform完全指南(第二版) #flight.Archives007
Title/ CSS Transform完全指南(第二版) #flight.Archives007 序: 第7天了! 终身学习, 坚持创作, 为生活埋下微小的信仰. 我是忘我思考,共同进步! 简介: ...
- No.3 - CSS transition 和 CSS transform 配合制作动画
课程概述 作业提交截止时间:09-01 任务目的 深度理解掌握 transition-timing-function 以及它的意义 学会配合使用 CSS transform 和CSS transiti ...
- CSS Transform / Transition / Animation 属性的区别
back21 Jun 2011 Category: tech Tags: css 最近想UI的动画转到css3能吃进3d加速的属性上面来以加强动画的连贯性.只是对于css几个新加的属性不太熟悉,常常容 ...
- Html CSS transform matrix3d 3D转场特效
Html CSS transform matrix3d 3D转场特效 透视矩阵 2n/(r-l) 0 (r+l)/(r-l) 0 0 2n/(t-b) (t+b)/(t-b) 0 0 0 (n+f)/ ...
- css: transform导致文字显示模糊
css: transform导致文字显示模糊 有人认为模糊的原因是:"transform时div的宽度或者高度并不是偶数,偏移 50% 之后,像素点不是整数,和显示像素没有对上". ...
- CSS transition & shorthand property order
CSS transition & shorthand property order shorthand property https://developer.mozilla.org/en-US ...
- 声学感知刻度(mel scale、Bark scale、ERB)与声学特征提取(MFCC、BFCC、GFCC)
梅尔刻度 梅尔刻度(Mel scale)是一种由听众判断不同频率 音高(pitch)彼此相等的感知刻度,表示人耳对等距音高(pitch)变化的感知.mel 刻度和正常频率(Hz)之间的参考点是将1 k ...
随机推荐
- python:json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes问题解决
有如下一个文件,内容如下 { "test1": "/root/test/test1.template", "test2": "/r ...
- 在Chrome 中使用Vimium
原文连接:https://blog.csdn.net/wuxianjiezh/article/details/91848604 Vimium:像在 Vim 中一样使用 Chrome 安装 使用方法 在 ...
- java对象的实例化过程
简单类对象的实例化过程 1.在方法区加载类: 2.在栈内存申请空间,声明变量P: 3.在堆内存中开辟空间,分配对象地址: 4.在对象空间中,对对象的属性进行默认初始化,类成员变量显示初始化: 5.构造 ...
- 设计模式-单例模式code
package singeton; import java.security.SecureRandom; /** * @author Zero * @since 2019-08-13. * Descr ...
- css3 伪类实现右箭头→
css3 实现右箭头→ <!DOCTYPE html> <html lang="en"> <head> <meta charset=&qu ...
- JS---DOM---总结绑定事件的区别
总结绑定事件的区别: addEventListener(); attachEvent() 相同点: 都可以为元素绑定事件 不同点: 1.方法名不一样 2.参数个数不一样addEventListen ...
- Cesium 本地部署案例
众所周知,cesium的服务器是搭建在国外的,所以我们国内的用户访问的时候贼慢.有时想查个api或者看个案例半天都进不去,今天我来说一下傻瓜式搭建本地的cesium环境,用于大家没事查资料用!步骤:1 ...
- iOS核心动画高级技巧 - 6
11. 基于定时器的动画 基于定时器的动画 我可以指导你,但是你必须按照我说的做. -- 骇客帝国 在第10章“缓冲”中,我们研究了CAMediaTimingFunction,它是一个通过控制动画缓冲 ...
- Linux文本处理三剑客之sed
推荐新手阅读[酷壳]或[骏马金龙]开篇的教程作为入门.骏马兄后面的文章以及官方英文文档较难. [酷壳]:https://coolshell.cn/articles/9104.html [骏马金龙-博客 ...
- java 读取 yaml 文件
做 java 项目用的最多的配置文件就是 properites 或者 xml, xml 确实是被用烂了,Struts, Spring, Hibernate(ssh) 无一不用到 xml.相比厚 ...