{"id":1073,"date":"2014-01-01T21:04:26","date_gmt":"2014-01-01T21:04:26","guid":{"rendered":"http:\/\/www.omniweb.com\/wordpress\/?p=1073"},"modified":"2014-01-01T21:06:41","modified_gmt":"2014-01-01T21:06:41","slug":"multiple-background-images-with-css-in-ie8","status":"publish","type":"post","link":"https:\/\/www.omniweb.com\/wordpress\/?p=1073","title":{"rendered":"Multiple background images with CSS in IE8"},"content":{"rendered":"<p>There are still a decent percent of browsers out there on the increasingly-antiquated Internet Explorer version 8.<br \/>\nSo while upgrading a site recently to an all-CSS based design, we wanted to continue to support IE8 and needed multiple background images on a single element using CSS.<br \/>\n<a href=\"http:\/\/www.webdesignetc.co\/faking-multiple-backgrounds-in-ie8\/\">This post was the most elegant explanation<\/a> I found.<\/p>\n<p>For future reference, here is the magic:<\/p>\n<p>HTML<\/p>\n<pre><code>\r\n    &lt;div class=\"container\"&gt;\r\n    \tI need 3 backgrounds!\r\n    &lt;\/div&gt;\r\n<\/code><\/pre>\n<p>We are going to apply multiple backgrounds in IE8 to this div.container by using the :after and :before psuedo classes in IE8.<br \/>\nCSS<\/p>\n<pre><code>\r\n    .container {\r\n    \tbackground-color: #eee; \/\/ A light gray\r\n    \theight:200px;\r\n    }\r\n\r\n    .container:before {\r\n    \tcontent: '';\r\n\t\tbackground-color: #3c3c3c; \/\/ A medium dark gray\r\n\t\twidth: 100%;\r\n\t\theight: 30px;\r\n\t\ttop: 0px;\r\n\t\tdisplay: block;\r\n\r\n\t\tz-index: 1;\r\n\t\tposition: relative;\r\n    }\r\n\r\n    .container:after {\r\n    \tcontent: '';\r\n\t\tbackground-color: #000; \/\/ Black\r\n\t\twidth: 100%;\r\n\t\theight: 10px;\r\n\t\ttop: 0px;\r\n\t\tdisplay: block;\r\n\t\tz-index: 1;\r\n\t\tposition: relative;\r\n    }\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>There are still a decent percent of browsers out there on the increasingly-antiquated Internet Explorer version 8. So while upgrading a site recently to an all-CSS based design, we wanted to continue to support IE8 and needed multiple background images &hellip; <a href=\"https:\/\/www.omniweb.com\/wordpress\/?p=1073\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1073"}],"collection":[{"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1073"}],"version-history":[{"count":3,"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1073\/revisions"}],"predecessor-version":[{"id":1076,"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1073\/revisions\/1076"}],"wp:attachment":[{"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1073"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1073"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1073"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}