Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

CSS3 Multiple Background images vertical

Posted on 2014-01-21
3
Medium Priority
?
460 Views
Last Modified: 2014-01-22
I'm new to multiple backgrounds in css3 but a peer of mine said that it might fix my problem.  I have a website with a content background that is an image that I need to stack in the middle.  So I have sliced an image into three different images and applied the css but I am having some repeating problems.

Here is site:

http://www.sendright.com/draft/lauren

code snippet:

#page {
      /*background: url('images/page_bg.png')no-repeat;
      background-size:100%;
      border: 1px solid #bbb;*/
      
      background-image: url('images/page_bg_top.png'),
            url('images/page_bg_middle.png'),
            url('images/page_bg_bottom.png');
      background-repeat: no-repeat, repeat-y, no-repeat;
      background-size:100%;
      border-radius: 10px;
}
0
Comment
Question by:gwarcher
3 Comments
 
LVL 38

Accepted Solution

by:
Tom Beck earned 2000 total points
ID: 39799638
Remove the second and third background images from #page. Adjust the background-repeat to background-repeat:no-repeat.

Add the second background image to #main. Add background-size:100%

Add the third background image to the footer,  #colophon. Add background-size:100% and height:68px.

That may not be all you need to do, but it will get you close.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39801370
You need to manage and position in 3 dimensions and manage the stacking order of the images.

This page with multiple backgrounds and transitions might help

You may want to use percentages for the positioning if you are trying to keep the page responsive, though you can also script re-alignment if you want to beat yourself up.

Cd&
0
 

Author Closing Comment

by:gwarcher
ID: 39802085
perfect, thanks for the help.  It's always the simplest solution.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When applying CSS to your HTML, there are many different ways to select which element(s) the CSS applies to.  Some of these selectors are more commonly known and used than others - Here are the more common ones: #X - Matches an ID of X .X - Matche…
As a result of several questions about how to use Bootstrap I thought it would be a good idea to write down the development aspect of creating a Bootstrapped website in as little time as possible. Part 1 of this article will only concentrate on g…
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question