分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 技术分享

CSS3有哪些新特性?

发布时间:2023-11-01 15:52责任编辑:林大明关键词:CSS

CSS3实现圆角 (border-radius: 8px)

阴影 (box-shadow: 10px)

对文字加特效 (text-shadow)

线性渐变(gradient)

旋转(transform):rotate(9deg)

缩放 (transform):scale(0.85,0.90)

倾斜(transform):skew(-9deg,0deg)

过渡效果(transition)

动画效果(animation)

增加了更多的选择器


CSS3选择器

nth-child 

nth-last-child(n)

nth-of-type(n)

nth-last-of-type(n)

last-child

first-of-type

only-child

only-of-type

empty

checked

enabled

disabled

selection

not(s)

first-child:第一个直接字节点


CSS3的Animation

 ???<style> ???????* { ???????????margin: 0; ???????????padding: 0; ???????} ???????@-webkit-keyframes animal { ???????????0% { ???????????????opacity: 0; ???????????????font-size: 12px; ???????????} ???????????100% { ???????????????opacity: 1; ???????????????font-size: 24px; ???????????} ???????} ???????.box { ???????????width: 100px; ???????????height: 100px; ???????????background-color: #f2f2f2; ???????????????????????-webkit-animation-name: animal; ???????????-webkit-animation-duration: 1.5s; ???????????-webkit-animation-iteration-count: 4; ???????????-webkit-animation-direction: alternate; ???????????-webkit-animation-timing-function: ease-in-out; ???????} ???</style> ???<div class="box">box</div>

animation有八个动画属性:

animation-name:              规定需要绑定到选择器的keyframe名称。

animation-duration:          规定完成动画所花费的时候,以秒或毫秒计。

animation-timing-function:规定动画的速度曲线

animation-delay:               规定动画开始之前的延迟。

animation-iteration-count: 规定动画播放的次数。

animation-direction:          规定是否应该轮流反向播放动画。

animation-fill-mode:          规定当动画不播放时()。

语法:

animation: name duration timing-function delay iteration-count direction fill-mode play-state;

CSS3有哪些新特性?

原文地址:https://www.cnblogs.com/still1/p/10802888.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved