1.渐变色
线性渐变:Linear gradients
linear-gradient ( position, color1, color2,…) position表示方向
background: linear-gradient(to right,red,green,yellow)
从左到右渐变为红 绿 黄 效果:
background: linear-gradient(to bottom, right,red,green,yellow)
最后延伸到右下,那就是从左上角到右下角渐变为红 绿 黄,效果:
径向渐变
background: radial-gradient(red,green,blue) 效果:
2.添加文本阴影
h1{text-shadow: 10px 20px 5px red; }
text-shadow属性
h-shadow 必需,水平阴影的位置,允许负值
v-shadow 必需,垂直阴影的位置,允许负值
blur 可选,模糊距离
color 可选,阴影颜色
3.多行省略号
overflow: hidden; 溢出隐藏。
white-space:nowrap 文本不会换行。
text-overflow: ellipsis; 用省略号代表溢出的文字。