Have 2 Images as background

Discussion in 'CSS' started by JimKarvo, Nov 19, 2007.

  1. #1
    Hello

    I have do that:

    [​IMG]

    Can I have the "image1.jpg" at the left red section, and the "image2.jpg" at the right red section? As Background image!

    Thank you for any help!

    Yours,
    JimKarvo
     
    JimKarvo, Nov 19, 2007 IP
  2. Noddegamra

    Noddegamra Peon

    Messages:
    1,013
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Yeah but it depends how you've made your site template.

    You could use tables or div's. Give each div an id, such as "div_left", "div_center" and "div_right".

    The in css have something like

    
    
    #div_left {
    background: url("images/image1.jpg");
    }
    
    #div_right {
    background: url("images/image2.jpg");
    }
    
    
    Code (markup):
     
    Noddegamra, Nov 19, 2007 IP
  3. StormForum

    StormForum Well-Known Member

    Messages:
    206
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    105
    #3
    with this in mind make sure you add no-repeat otherwise the images would persistently repeat in the div boxes.
     
    StormForum, Nov 19, 2007 IP
  4. Noddegamra

    Noddegamra Peon

    Messages:
    1,013
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I left it out incase he wanted it to repeat. Like when using a background texture :)


    you can also use repeat-x and repeat-y to have it repeat in one direction only :)
     
    Noddegamra, Nov 19, 2007 IP
  5. pylon

    pylon Peon

    Messages:
    88
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    you aren't able to use the "background" tag though are you?
     
    pylon, Nov 19, 2007 IP
  6. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #6
    pylon, there is no such thing as a background tag, although there is a deprecated (read: obsolete) attribute that shouldn't be used since it's a presentational HTML attribute that is handled even better with CSS (which also has far more options available to it than the plain old obsolete HTML attribute) anyway.
     
    Dan Schulz, Nov 19, 2007 IP
  7. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I heard Safari allows multiple background images for each element. If this is true, and is a site for only (for instance) Mac users, then that red area would just be the body with two backgound images positioned at 0,0 and 100%,0. I've heard of Mac sites that are written with no thought to other browsers since the assumption is that Mac users aren't going to visit with FF or IE. An possibly later, other browsers will begin to allow this too... far, far in the future... maybe... : (
     
    Stomme poes, Nov 19, 2007 IP
  8. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Safari 3 does, and it's a CSS3 property. Even if Opera and Firefox (as well as other Gecko based browsers) implement it, I don't see IE doing so for a long time.
     
    Dan Schulz, Nov 20, 2007 IP
  9. Crimsonc

    Crimsonc Peon

    Messages:
    616
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #9
    provide your url or we can't help you, we can only make assumptions.
     
    Crimsonc, Nov 21, 2007 IP
  10. soulscratch

    soulscratch Well-Known Member

    Messages:
    964
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    155
    #10
    Try setting a background image on the html element, and another on the body perhaps?
     
    soulscratch, Nov 21, 2007 IP