: Top and bottom gradient using CSS I have a background that has a top and bottom gradient and I want it to show on a container layer. The problem is the bottom gradient since it has to appear
I have a background that has a top and bottom gradient and I want it to show on a container layer. The problem is the bottom gradient since it has to appear at the very end of the container div. Any ideas? Here's some example code & imgur photo:
<style>
.container{background: #fff url(images/bg.png) repeat-x;}
</style>
<div class="container">
<div id="content">
<p>Dynamic stuff goes in here that differs on every page</p>
</div>
</div>
imgur.com/XAaIx
The above code only shows the gradient at the top, but is there another way to achieve this effect?
More posts by @Welton855
2 Comments
Sorted by latest first Latest Oldest Best
you could use css rules for multiple backgrounds
div.container {
background-image: url(images/bg_top.png), url(images/bg_bottom.png);
background-repeat: repeat-x;
background-position: top left, bottom left;
}
That should work.
You could try something like:
<style>
.container{background: #fff url(images/bg_bottom_gradient.png) repeat-x;}
.subcontainer{margin: 0 auto;background-image:url(images/bg_top_gradient.png);background-repeat: repeat-x;}
</style>
<div class="container">
<div class="subcontainer">
<div id="content">
<p>Dynamic stuff goes in here that differs on every page</p>
</div>
</div>
</div>
EDITTED TO ADD NEW STYLE:
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.