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 6117017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:16:21+00:00 2026-05-23T15:16:21+00:00

I am trying to do a little thing with CSS3… I would like to

  • 0

I am trying to do a little thing with CSS3… I would like to set for a bunch of elements with class “.myClass” a gradient with -xxx-linear-gradient (generated with colorzilla.com/gradient-editor for compatibility).
But each of these elements with class “.myClass” has an Id, and depending on the Id, I would like to add different background-images on the top of gradients (as in a multiple background statement).
Something like this:

.myClass {
    /* linear gradient... */
}

#myId1 {
    background-image: url(img1.png); /* or background: url(...), same result */
}

#myId2 {
    background-image: url(img2.png);
}

The problem is that the images defined with the #Ids replace the gradient instead of making multiple backgrounds. I could copy the gradient CSS code to each Id, and then have multiple backgrounds, but the compatibility code given by colorzilla is quite huge for just a gradient, so copying it in each id would make the code more unreadable…

Ids have the priority, but I was wondering if there was a way to “add” the second background-image instead of replacing it.

If you have any idea, thanks a lot!

  • 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-23T15:16:22+00:00Added an answer on May 23, 2026 at 3:16 pm

    You can’t use multiple background in separate background statements. If you want multiple backgrounds, you have to declare them all in one background statement. This is because in multiple background statements, the rendering engine assumes you mean to replace the previously-set background with the new one, instead of adding to what’s there.

    One thing I generally do with CSS3, particularly when still needing all of the vendor prefixes, is to put all the CSS3 into its own file. That way, the rest stays readable and it’s not mixed into the main CSS.

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

Sidebar

Related Questions

im trying to make a little forum type thing. so how would i do
I'm building a little Twitter thing in PHP and I'm trying to parse URLs,
I'm trying to use javascript as little as possible on this project. I would
I've been trying to set up Notepad++ as a little Java environment, mainly for
I'm trying to learn reverse engineering, and I'm stuck on this little thing. I
I'm trying a little concept test to change one of the features of the
I am trying out a little reflection and have a question on how the
I'm going a little nuts trying to understand the doc on impersonation and delegation
I'm going a little nuts trying to figure out how to use template inheritance
After trying my hand at Perl and a little bit of C, I am

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.