CSS 高级使用
其他
2020-10-16 14:37:05
阅读次数: 0
CSS 高级使用
本文内容
- 选择器
1. 选择器
- 选择第几个子元素
p:nth-of-type{
}
p:nth-child{
}
2. 变换
- tranform
- translate()
- rotate()
- scale()
- skew()
- matrix()
- transform-origin 控制转换原点
3. 过渡
- transition-property
- transition-duration
- transition-timing-function
- linear
- ease
- ease-in
- ease-out
- ease-in-out
- cubic-bezier(n,n,n)
- transition-delay
- transition: property duration timing-function delay; 简写方式
4. 鼠标交互
- hover 覆盖
p:hover span{color: red;}
- 表示p上有鼠标时,span字体颜色变为 red
p:hover + span
表示p后面一个span
p:hover ~ span
表示p 后面的span,不一定需要 临近 p标签
5. 圆角
- 单属性
- 双属性
border-radius: 左上与右下 右上与左下
- 三属性
border-radius: 左上 右上与左下 右下
- 四属性
border-radius: 左上 右上 右下 左下
- border radius 可以设置 百分比
6. 动画
- animation
- 创建动画
@keyframes xxx{
from {}
to {}
}
- 绑定选择器
div {
animation: xxx;
}
转载自blog.csdn.net/weixin_42290927/article/details/108203528