Transparent PNG for Dynamic Background Gradients

CSS Tricks

Here’s a quick little trick I’ve used for a variety of applications. It involves using a transparent png or gif with a gradient to allow you to create dynamic background gradients.

The first step is to create a gradient – I use Fireworks. Adjust the opacity to zero for the top side and 80% for the bottom.

Here’s an example of the CSS

{code type=CSS}
.this_div {
height:50px;
width:100%;
background:url(trans.png) #990 bottom;
}
{/code}

Here’s an example of the HTML

{code type=CSS}

<div class=”this_div”></div>

{/code}

Here’s the final result.

Leave a Reply

Your email address will not be published. Required fields are marked *

What's the Buzz?

Andy is a true top notch programmer with a great eye for design, style and balance. When I out source web development projects, I look for qualified and competent programmers that can understand the big picture, add value throughout entire process, and pays close attention to the details – Andy fits the bill.

Andy is well-versed in web development using various programming languages and CMS platforms. Andy is able to deliver a flawless website based on the creative vision and project requirements. He is able to do it on time and on budget.

I highly recommended Andy as a web developer and give him four stars on his professionalism.

- John LeDonne
LeDonne Creative