3 images as a background?

Is it possible to add 3 images as a background image? Left, Middle and Right?

What Im trying to do is set a left image and a right image to a div, and the middle image expand into the middle?

Is this even possible?
tonelm54Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

unrealized92Commented:
It's definitely possible. Try something like this:

body {
background: url(images/image-1.png), url(images/image-2.png),url(images/image-3.png);
background-repeat: no-repeat, repeat-x, repeat-y;
background-position:10px 20px , 20px 30px ,15px 25px;
}

Open in new window


a simple way to adjust you every image position with background-position: and set repeat property with background-repeat: for every image individually
tonelm54Author Commented:
Ive just tried with the following code:-
<!DOCTYPE HTML>

<html>

<head>
  <title>Untitled</title>
  <style type="text/css">
     .tab {
        width:200px;
        height:41px;

        background: url(WhiteL.png), url(WhiteM.png),url(WhiteR.png);
        background-repeat: no-repeat, repeat-x, no-repeat;
        background-position:0px 0px , 14px 0px , 186px 0px;
     }

  </style>

</head>

<body>
  <div class="tab">

  </div>
</body>

</html>

Open in new window


However all I get is:-
Screenshot 1
But what I should get is:-
Screenshot 2
Im using the following images to make up the image:-
WhiteL.pngWhiteMWhiteR
Any ideas what Im doing wrong?

Thank you
Tom BeckCommented:
The repeating image has a white background and that is obscuring the right background image.

Change the order of your images so the repeating image is last. That will put it on the bottom in terms of z-index so the right image can show on top of it.
.tab {
        width:200px;
        height:41px;

        background: url(WhiteL.png),url(WhiteR.png),url(WhiteM.png);
        background-repeat: no-repeat, no-repeat, repeat-x;
        background-position:0 0, 186px 0, 14px 0;
     }

Open in new window

David S.Commented:
Why use images when you could use border-radius?

.tab {
        width: 198px;
        height: 39px;
	border: 1px solid #42709a;
	-webkit-border-top-left-radius: 12px;
	-webkit-border-top-right-radius: 12px;
	-moz-border-radius: 12px 12px 0 0;
	border-radius: 12px 12px 0 0;
}

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
No points for this comment.

I do think you are better off using the alternative method Kravimir suggests.  What you originally have would have been done a long time ago when browsers did not fully support rounded corners.  A big advantage to this method is it the ease of making it responsive since there are no images.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
CSS

From novice to tech pro — start learning today.