To fix this, add a margin-top (to the content) that is equal or larger than the height of your menu. You may also use the background shorthand, however this removes the fallback color and image. Step 2) Add CSS: To create a fixed top menu, use position:fixed and top:0.Note that the fixed menu will overlay your other content. To only apply a setting to one image, set the default for the other: background-position: 50%, 0 0 or for browsers that support it use initial: background-position: 50%, initial However using background-size: 40px, cover will make the image 40px and the gradient will cover the element. background-size: 40px will constrain both the image and the gradient to 40px height and width. If only 1 value is supplied, that will be applied to all stacked images including the gradient. Other properties that would apply to a single image may also be comma separated. To use a single fallback image in this case I suggest using Paul Irish's wonderful Conditional HTML element along with your fallback code. This does not happen when a gradient is included. However to be noted when using only images, ie < 9 will ignore the fallback statement and not show any image. You could use this to create a gradient image for ie9, though personally, I wouldn't. IE9 and up can stack images this same way. Stacking images ONLY (no gradients in the declaration) For IE < 9 In this case, the image is on TOP of the gradient.įor more information about background layering see. It should be noted that the first defined image will be topmost in the stack. background:url (smiley.gif) 10px 20px/50px 50px will result in a background image, positioned 10 pixels from the left, 20 pixels from the top, and the size of the image. For a good post on why you don't need multiple browser prefixes, see Note: If one of the properties in the shorthand declaration is the bg-size property, you must use a / (slash) to separate it from the bg-position property, e.g. Nearly all current browsers have support for multiple background images and css backgrounds.