css中的背景色渐变以及背景图的定位
2015-12-03 11:22
579 查看
单纯的背景色渐变:
background: -webkit-gradient(linear, 0 0, 0 100%, color-stop(0, #fff), color-stop(1, #ddd));
background: linear-gradient(to bottom, #fff 0px, #ddd 100%) repeat scroll 0% 0%;
可以同时支持谷歌、火狐浏览器,兼容性比较强。
背景图的位置:
background:url("images/taocan-bg.png") no-repeat -315px 0px;
background:url("images/taocan-bg.png") no-repeat -315px bottom;
这两个是有区别的,bottom有的时候不显示,而0px会显示。
background: -webkit-gradient(linear, 0 0, 0 100%, color-stop(0, #fff), color-stop(1, #ddd));
background: linear-gradient(to bottom, #fff 0px, #ddd 100%) repeat scroll 0% 0%;
可以同时支持谷歌、火狐浏览器,兼容性比较强。
背景图的位置:
background:url("images/taocan-bg.png") no-repeat -315px 0px;
background:url("images/taocan-bg.png") no-repeat -315px bottom;
这两个是有区别的,bottom有的时候不显示,而0px会显示。
相关文章推荐
- css 父div如何包裹带有float属性的子div,float子div如何撑开父div
- css绝对定位&相对定位
- css颜色编码对照大全
- CSS属性的陷阱
- CSS之清除浮动
- Qt—样式表(setStyleSheet())
- CSS3 经典教程系列:CSS3 圆角(border-radius)详解
- 用纯css改变下拉列表select框的默认样式
- CSS整理的答疑
- IE8对css文件的限制
- 下拉选项样式整理
- css3 中的content 使用方法。
- css中float属性和position
- css中margin和padding
- CSS3 中FLEX快速实现BorderLayout布局
- css样式表
- css 样式表
- CSS3 中FLEX快速实现BorderLayout布局
- WPF自定义控件与样式(14)-轻量MVVM模式实践
- IE和Chrome样式兼容性问题