css3有哪些新特性(简单介绍) 发布时间:2025/01/20 css3语法中引用了很多新的特性,下面编程教程网小编给大家简单介绍一下! 伪元素选择器 p::before{ content: "→ "; } 复制代码 属性选择器 [title]{ color: #f00; } 复制代码 线性渐变 .gradient { background: linear-gradient(to bottom, #ffffff, #000000); } 复制代码 径向渐变 .gradient { background: radial-gradient(circle at center, #ffffff, #000000); } 复制代码 过渡属性 .btn { color: black; transition: color 0.5s ease-out; } .btn:hover { color: white; } 复制代码 动画效果 .circle { width: 100px; height: 100px; border-radius: 50%; background-color: blue; animation: circle-color 5s alternate infinite; } @keyframes circle-color { 0% { background-color: blue; } 50% { background-color: yellow; } 100% { background-color: red; } } 复制代码 平移变形 .box { transform: translate(20px, 20px); } 复制代码 缩变形 .box { transform: scale(2); } 复制代码 旋转变形 .box { transform: rotate(45deg); } 复制代码 以上是编程学习网小编为您介绍的“css3有哪些新特性(简单介绍)”的全面内容,想了解更多关于 前端知识 内容,请继续关注编程基础学习网。