css gradiant div

Posted on 2009-12-21
Medium Priority
Last Modified: 2012-05-08
Greetings - is there a way to get the background of a div to display as a gradiant without using an image?  If so how?  I've seen some css workaround from back in 2005, but surely there's a more backed in method to do this in CSS these days?

THanks in advance.
Question by:crmsharepoint

Assisted Solution

FDMilwaukee earned 600 total points
ID: 26101380
the answer for all practical purposes is yes & no.  Does that help? j/k  And just out of curiosity what advantage would you hope to gain over using an image.  Using the image does not slow performance.  

It is possible to do with extensive coding, but it would hardly be worth it, and you would not have cross browser compatibility.

Most of the links provided are browser specific.
Here's some links you may find interesting:

Here is a another EE post regarding the same question, and giving more or less the same answer I am.

Hope that helps
LVL 13

Accepted Solution

qwerty021600 earned 1200 total points
ID: 26102547
try this but it'll work only in IE
    filter :   progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=white,endColorStr=#B7D6E4);
      height: 100%;
LVL 16

Assisted Solution

s8web earned 200 total points
ID: 26105087
There is no css2 support for this, but if you are okay with a little js, I can vouch that this works well http://slayeroffice.com/code/gradient/


Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Creating a CSS block that only applies to printing By default, all of your CSS applies to every possible view of your page - whether on screen, printed, landscape, touch-screen, or whatever.  You can, however, add CSS that only applies under certai…
This article discusses four methods for overlaying images in a container on a web page
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…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Suggested Courses
Course of the Month16 days, 16 hours left to enroll

862 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