Multiple background images in one div

后端 未结 4 2067
不知归路
不知归路 2020-12-11 01:26

I made a ribbon in Photoshop. The ribbon has three part. The left and right parts are a fixed 10px. The middle sectoin is a repeatable pattern.

Is it possible to com

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-11 01:59

    Just add a class to the tag, then using CSS add the background to that class. This will not work on IE8 or earlier

    div
    { 
    background:url(smiley.gif) top left no-repeat,
    url(sqorange.gif) bottom left no-repeat,
    url(sqgreen.gif) bottom right no-repeat;
    }
    

    Code is from http://www.w3schools.com/cssref/css3_pr_background.asp

    To get it to work in other versions of IE you can use something like CSS3Pie http://css3pie.com/documentation/supported-css3-features/#pie-background However I would test thoroughly before putting the code live

提交回复
热议问题