CSS3

94 阅读1分钟

border-radius:圆角,值越大越圆。如果是写4个值要按照顺时针顺序。

box-shadow默认是外阴影,不设置inset,自动就是外阴影,如果设置inset 就变成了内阴影。顺序(box-shadow: x轴距离, y轴距离, 模糊半径的大小, 模糊的颜色)

list-style-type 简写list-style (circle 空心圆,decimal 数字,disc 实心圆 默认的,disclosure-closed 树形图的关闭箭头,disclosure-open 树形图的打开箭头,none 没有任何样式)

background-sizing:背景图大小,如果只给出一个值,第二个是设置为"auto(自动)。

background-size: cover;此时会保持图像的纵横比并将图像缩放成将完全覆盖背景定位区域的最小大小。

background-size: cover;此时会保持图像的纵横比并将图像缩放成将适合背景定位区域的最大大小。

线性渐变:从上往下background: linear-gradient(to bottom,red,green,blue); 从下往上background: linear-gradient(to top,red,green,blue);从左往右background: linear-gradient(to right,red,green,blue);从右往左background: linear-gradient(to left,red,green,blue);从右上到左下background: linear-gradient(to left bottom,red,green,blue);从左下到右上background: linear-gradient(to top right,red,green,blue);

径向渐变:background: radial-gradient(red 5%,green 30%,blue 60%); background: radial-gradient(circle,red 10%,green 30%,blue 60%);

文字属性: overflow: hidden;溢出隐藏。text-overflow: ellipsis;超出的文本用省略号来表示。white-space: nowrap;文本不会换行,在同一行继续。

font:@font-face;定义字体,这个字体只针对英文 ,中文不生效。

给字体起一个名字,font-family: myfont;