Image either side of a div?

Discussion in 'CSS' started by le007, Mar 21, 2009.

  1. #1
    Hi all,
    I want a jpg either side of a div to give it a gradient affect into the backfround - I remember seeing this done before but can't find it on google now - any ideas?
    Thanks
     
    le007, Mar 21, 2009 IP
  2. andy10k

    andy10k Peon

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It's probably easier to do by combining your two images into one so that the left and right ends fade into the background. Cut your image so that it's only one pixel high and is the width you want.

    Put your background in one div and your content in another, then make sure your content div is inside the background div.

    Give your div a id then use css to make your image repeat in the background.

    Try

    html

    <div id="background">
    <div id="content">
    Content
    </div>
    </div>

    #background {text-align:center; background:url(backgroundimage.jpg) top left repeat-y;}

    See how that goes, if you want then post your code as it is and I'll have a look at it.
     
    andy10k, Mar 22, 2009 IP
  3. le007

    le007 Well-Known Member

    Messages:
    481
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #3
    Thanks a lot Andy - yeah I get the idea and it worked, cheers!
     
    le007, Mar 22, 2009 IP