- css添加渐变效果可以用如下代码:
background:linear-gradient(bottom,rgba(0,0,0,1),rgba(0,0,0,.4));
线性渐变 从底部向上 由黑色不透明到黑色0.4透明 还有一种放射渐变:radial-gradient,由中心向四周发射
在safari、chrome还有opera中:background:-webkit-linear-gradient
在firefox中:background:-moz-linear-gradient
IE浏览器暂时不支持渐变
效果图:
注释:
-moz-代表firefox浏览器私有属性
-ms-代表IE浏览器私有属性
-webkit-代表chrome、safari私有属性 - 加载网络字体在
<head>
标签中加:
<link href="https://fonts.googleapis.com/css?family=Londrina+Shadow" rel="stylesheet">
这是谷歌字体库中的字体,然后再在样式表中加入该字体就可以了