css中的背景色渐变以及背景图的定位

时间:2015-12-03 13:17:04   收藏:0   阅读:343

 

单纯的背景色渐变:

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会显示。

原文:http://www.cnblogs.com/wangyongx/p/5015561.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!