CSS3支持同时使用图片和渐变作为单一< div&gt ;?的背景吗? [英] Does CSS3 support using both an image and a gradient for the background of a single <div>?

查看:430
本文介绍了CSS3支持同时使用图片和渐变作为单一< div&gt ;?的背景吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道你可以在CSS3中的单个< div> 上做多个背景,但是可以混合图像引用的背景(即<$ c $ (<... code> -moz-linear-gradient(...)) url(...) / p>

如果是,语法是什么?



如果没有,什么是最佳实践结果?



感谢。

解决方案

>

  background:-moz-linear-gradient(-45deg,rgba(0,0,255,0),rgba(0,0,255,1) ),url(image); 

可以在 http://software.hixie.ch/utilities/js/live-dom-viewer/saved/675 。 p>

注意,当然,CSS渐变仍然不断。


I know you can do multiple backgrounds on a single <div> in CSS3, but is it possible to mix an image-referencing background (i.e. url(...)) with a gradient generating background (e.g. -moz-linear-gradient(...))?

If so, what is the syntax?

If not, what is a best-practice to achieve the same result?

Thanks.

解决方案

You can!

background: -moz-linear-gradient(-45deg, rgba(0,0,255,0), rgba(0,0,255,1)), url("image");

which can be seen live at http://software.hixie.ch/utilities/js/live-dom-viewer/saved/675.

Note, of course, that CSS gradients are still in flux.

这篇关于CSS3支持同时使用图片和渐变作为单一&lt; div&gt ;?的背景吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆