CSS: background image on background color
You need to use the full property name for each: Or, you can use the background shorthand and specify it all in one line:
You need to use the full property name for each: Or, you can use the background shorthand and specify it all in one line:
I’m trying to make a “fade-in fade-out” effect using the CSS transition. But I can’t get this to work with the background image… The CSS: Take a look: http://jsfiddle.net/AK3La/
Specify height: 100% on the html, body and #body2 elements (line 1358). Not tested in IE 6, works in 7 though.
You can achieve this with the background-size property, which is now supported by most browsers. To scale the background image to fit inside the div: To scale the background image to cover the whole div: JSFiddle example There also exists a filter for IE 5.5+ support, as well as vendor prefixes for some older browsers.
Updated Answer: It’s been commented multiple times that this is not the correct answer to this question, and I agree. Back when this answer was written, IE 9 was still new (about 8 months old) and many developers including myself needed a solution for <= IE 9. IE 9 is when IE started supporting background-origin. However, it’s … Read more
As c-smile mentioned: Just need to remove the apostrophes in the url(): Demo here
You need to add a width and a height of the background image for it to display properly. For instance, As you mentioned that you are using it as a shadow, you can remove the width and add a background-repeat (either vertically or horizontally if required). For instance, PS: XX is a dummy value. You need to replace it with your actual values … Read more
And in css: EDIT: As iGEL noted, this solution is officially deprecated (still works though), so if you are starting from scratch, you should go with the jnpcl’s border-collapse solution. I actually quite dislike this change so far (don’t work with tables that often). It makes some tasks bit more complicated. E.g. when you want … Read more
Check out this pen. You will have to use two different containers, one for the background image and the other for your content. In the example, I have created two containers, .background-image and .content. Both of them are placed with position: fixed and left: 0; right: 0;. The difference in displaying them comes from the z-index values which have been set differently for the … Read more
According to your CSS file path, I will suppose it is at the same directory with your HTML page, you have to change the url as follows: