HTML网页渐变色+背景图
html页面渐变与背景图二者想同时生效,渐变色必须采用。/* 标准的语法 */
·
背景图
<style type="text/css">
.div1
{
background: url(image/search.png) center center no-repeat;
}
</style>
渐变色
<style type="text/css">
.div1
{
background: linear-gradient(to right, #ffffff, #00000) center center no-repeat;
}
</style>
背景图+渐变
<style type="text/css">
.div1
{
background: linear-gradient(to right, rgba(236, 225, 255,1),rgba(245, 241, 255,0.5)) ,
url(image/img-zhihuidai.png) center right 30% no-repeat; /* 标准的语法 */
}
</style>
注:二者想同时生效,渐变色必须采用 rgba 格式
更多推荐
已为社区贡献3条内容
所有评论(0)