使用萨斯/北斗多背景图片 [英] Multiple Background Images using Sass / Compass

查看:166
本文介绍了使用萨斯/北斗多背景图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下使用上海社会科学院/罗盘会生成一个base64直列图片:

The following generates a base64 inline-image using sass/compass:

background-image:inline-image("paper.jpg", 'image/jpg');

有没有办法做多背景图片,或者我有preCOM preSS他们自己做呢?

Is there a way to do multiple background images, or do I have to precompress them myself to do it?

感谢。

推荐答案

内联图像函数只是输出的URL()的字符串,因此您可以通过这样使用多个:

The inline-image function just outputs the url() string, so you can use multiple by doing this:

background: inline-image("front-image.jpg", 'image/jpg') no-repeat, inline-image("back-image.jpg", 'image/jpg') repeat-x

,你会得到下面的CSS:

And you'll get the following css:

background: url('data:"image/jpg";base64,FRONTIMAGEDATAHERE') no-repeat, url('data:"image/jpg";base64,BACKIMAGEDATAHERE') repeat-x;

我补充说:不重复和重复-X,否则正面形象将重复并覆盖背面图像。

I added "no-repeat" and "repeat-x" otherwise the front-image will repeat and cover the back-image.

这篇关于使用萨斯/北斗多背景图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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