Results 1 to 8 of 8

Thread: possible to have 2 backgroung images?

  1. #1
    Join Date
    Aug 2007
    Posts
    45
    Thanks
    27
    Thanked 0 Times in 0 Posts

    Default possible to have 2 backgroung images?

    May I know if it is possible to have 2 backgroung image,one on the left of the page and one on the right? If so how should i incorporate the image on the left in the code below? Many thanks in advance

    BODY {
    background: #000000 url(image1.jpg')
    no-repeat fixed right center; }

  2. #2
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    You can have two div elements in left and right of your page and can set different background image for each of them.

  3. The Following User Says Thank You to codeexploiter For This Useful Post:

    amyy (03-28-2008)

  4. #3
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Or you can just use one image, but it is impossible to have 2 background images on a page. Period.
    Jeremy | jfein.net

  5. The Following User Says Thank You to Nile For This Useful Post:

    amyy (03-28-2008)

  6. #4
    Join Date
    Aug 2007
    Posts
    45
    Thanks
    27
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by codeexploiter View Post
    You can have two div elements in left and right of your page and can set different background image for each of them.
    May I know the code for two div elements in left and right of your page?

  7. #5
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    This:
    Code:
    <style type="type/css">
    #bg1 {
    background: url('image.png') no-repeat;
    width: 300px;
    height: 500px;
    }
    #bg2 {
    background: url('image2.png') no-repeat;
    width: 300px;
    height: 500px;
    }
    </style>
    <div id="bg1">This is the first background</div>
    <div id="bg2">This is the second one</div>
    Jeremy | jfein.net

  8. The Following User Says Thank You to Nile For This Useful Post:

    amyy (03-28-2008)

  9. #6
    Join Date
    Aug 2007
    Posts
    45
    Thanks
    27
    Thanked 0 Times in 0 Posts

    Default

    Thank you very much.
    I like to have 2 different images on the background, one on the left and one on the right.
    The center is the contents of the page which can be scrolled up.
    I tried using the above code but none of the 2 pictures appear

  10. #7
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    background: url('image2.png') no-repeat;
    states that the image in is the same folder as the page that is accessing... so if your page was
    Code:
    http://www.ddforums.com/forums/thread.html
    that script is saying your image is located at
    Code:
    http://www.ddforums.com/forums/image2.png
    so just check the paths of the images in relation to the script (page) you are trying to access them from...

    if the image are in the folder above the current one, just
    Code:
    ../image2.png
    and if the image is in a sub-folder of the the current folder do
    Code:
    folder/image2.png
    The last thing is png files are HUGE, they take up a lot of band width, and they are of excellent quality, which usually isn't something that matters for a background image. My suggestion is that you optimize those images into a more "web-friendly" format such as GIF or JPG. This can be done with almost any image editing software, just hit "Save As" and choose one of those formats

  11. #8
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Hi Amyy,

    Even if you have the right image paths, Nile's code won't give you what (assuming that I understand you right).

    What you want is something like this: http://www.dynamicdrive.com/style/la...frames-layout/

  12. The Following User Says Thank You to Medyman For This Useful Post:

    amyy (03-29-2008)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •