css3有哪些新特性?(包含哪些模块)

 分类:前端问答时间:2022-02-15 07:30:53点击:

css3有哪些新特性?包含哪些模块?以下是整理的21个css3新特性:

1.新增选择器

p:nth-child(n){color: rgba(255, 0, 0, 0.75)}

2.新增伪元素

::before 和 ::after

3.弹性盒模型

display: flex;

4.多列布局

column-count: 5;

5.媒体查询 

@media (max-width: 480px) {.box: {column-count: 1;}}

6.个性化字体 

@font-face{font-family: BorderWeb; src:url(BORDERW0.eot);}

7.颜色透明度

color: rgba(255, 0, 0, 0.75);

8.圆角

border-radius: 5px;

9.渐变 

background:linear-gradient(red, green, blue);

10.阴影

box-shadow:3px 3px 3px rgba(0, 64, 128, 0.3);

11.倒影 

box-reflect: below 2px;

12.文字装饰

text-stroke-color: red;

13.文字溢出 

text-overflow:ellipsis;

14.背景效果

background-size: 100px 100px;

15.边框效果

border-image:url(bt_blue.png) 0 10;

16.旋转

transform: rotate(20deg);

17.倾斜

transform: skew(150deg, -10deg);

18.位移

transform: translate(20px, 20px);

19.缩放

transform: scale(.5);

20.平滑过渡 

transition: all .3s ease-in .1s;

21.动画 

@keyframes anim-1 {50% {border-radius: 50%;}} animation: anim-1 1s;

除注明外的文章,均为来源:老汤博客,转载请保留本文地址!
原文地址: