您的位置:首页 > Web前端 > CSS

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会显示。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: