Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 708653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:24:54+00:00 2026-05-14T04:24:54+00:00

How do I use CSS3 gradients for my background-color and then apply a background-image

  • 0

How do I use CSS3 gradients for my background-color and then apply a background-image to apply some sort of light transparent texture?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T04:24:55+00:00Added an answer on May 14, 2026 at 4:24 am

    Multiple backgrounds!

    body {
      background: #eb01a5;
      background-image: url("IMAGE_URL"); /* fallback */
      background-image: url("IMAGE_URL"), linear-gradient(#eb01a5, #d13531); /* W3C */
    }

    These 2 lines are the fallback for any browser that doesn’t do gradients.
    See notes for stacking images only IE < 9 below.

    • Line 1 sets a flat background color.
    • Line 2 sets the background image fallback.

    The final line sets a background image and gradient for browsers that can handle them.

    • Line 3 is for all relatively modern browsers.

    Nearly all current browsers have support for multiple background images and css backgrounds. See http://caniuse.com/#feat=css-gradients for browser support. For a good post on why you don’t need multiple browser prefixes, see http://codepen.io/thebabydino/full/pjxVWp/

    Layer Stack

    It should be noted that the first defined image will be topmost in the stack. In this case, the image is on TOP of the gradient.

    For more information about background layering see http://www.w3.org/TR/css3-background/#layering.

    Stacking images ONLY (no gradients in the declaration) For IE < 9

    IE9 and up can stack images this same way. You could use this to create a gradient image for ie9, though personally, I wouldn’t. However to be noted when using only images, ie < 9 will ignore the fallback statement and not show any image. This does not happen when a gradient is included. To use a single fallback image in this case I suggest using Paul Irish’s wonderful Conditional HTML element along with your fallback code:

    .lte9 #target{ background-image: url("IMAGE_URL"); }
    

    Background position, sizing etc.

    Other properties that would apply to a single image may also be comma separated. If only 1 value is supplied, that will be applied to all stacked images including the gradient. background-size: 40px; will constrain both the image and the gradient to 40px height and width. However using background-size: 40px, cover; will make the image 40px and the gradient will cover the element. 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;

    You may also use the background shorthand, however this removes the fallback color and image.

    body{
        background: url("IMAGE_URL") no-repeat left top, linear-gradient(#eb01a5, #d13531);
    }
    

    The same applies to background-position, background-repeat, etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How would one use CSS3 gradients for a background image, and fallback to a
I'm trying use make a div's background transparent using a mixture of CSS3 rgba()
I am in need of some help, i am trying to use css3 animations
I use Firebug and the Mozilla JS console heavily, but every now and then
I use a stream reader to import some data and at the moment I
After my 1st question with relation to CSS3 gradients in which I was recreating
Is there a way to take a DIV that has a background image on
I would like to use CSS3 selectors (such as :nth-child), but they aren't supported
I'm attempting to use CSS3's resize to make an absolutely positioned div resizable in
How can I use CSS3 in Aptana Studio 2.0 with the AIR plugin? I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.