Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS CSS Multiple Backgrounds

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #44755
    SilverSerpent
    Participant

    I am having a really confusing problem that seems like it should be super simple. I have this code:

    `html {
    background:
    #f00,
    url(“../images/image.jpg”);
    }`

    but this just gives me a white background. It works with just red or just the image, but when I put them both together it doesn’t work for some reason. Any ideas?

    #134971
    wolfcry911
    Participant

    remove the comma

    #134972
    SilverSerpent
    Participant

    Thanks for the answer, but that does not work. I am trying to make it so that the red appears on top of the image, eventually I will change the red to an rgba value

    #134975
    Paulie_D
    Member

    >I am trying to make it so that the red appears on top of the image, eventually I will change the red to an rgba value

    You can’t do it that way.

    You can have multiple background **images** but not a color AND and image.

    At the moment you are stating make the background color red and overlay an image. If any parts of the image are transparent the red will show through.

    No sure (without trying) if you could define a second bg image as a solId gradient and do it that way…I’ll try when I get back to my desk. I have a feeling that you can’t and you’d have to go with a repeating png.

    #134976
    SilverSerpent
    Participant

    Thanks for your help! Using a gradient works perfectly. It seems odd that you can use a gradient with a background image but not a color though.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘CSS’ is closed to new topics and replies.