Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8638775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:49:21+00:00 2026-06-12T10:49:21+00:00

Possible Duplicate: Is it possible to graduate the opacity of an HTML element? I

  • 0

Possible Duplicate:
Is it possible to graduate the opacity of an HTML element?

I am trying to get a div (and its border and contents) to fade into transparency (ie solid at the top and transparent at the bottom) using css.

Is there a way to do this?

Ive been able to fade the background out with the following:

.fade-to-nothing
{
    background-image: -moz-linear-gradient(top, rgba(255,255,255,1), rgba(255,255,255,0));
    background-image: -webkit-gradient(linear, 0 0, 0 100%, from(rgba(255,255,255,1)), to(rgba(255,255,255,0)));
    background-image: -webkit-linear-gradient(top, rgba(255,255,255,1), rgba(255,255,255,0));
    background-image: -o-linear-gradient(top, rgba(255,255,255,1), rgba(255,255,255,0));
    background-image: linear-gradient(to bottom, rgba(255,255,255,1),rgba(255,255,255,0));
    background-repeat: repeat-x;
}

but haven’t been able to find a way to do it to the content/border of the div as well. perhaps with some kind of nesting or an overlay?

EDIT
heres what I was trying to do:

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T10:49:22+00:00Added an answer on June 12, 2026 at 10:49 am

    Quoting from my answer here:

    Check this working demo, and try to add/remove contents from #contents

    HTML

    <div id="container">
        <div id="contents">
            Some contents goes here
        </div>
        <div id="gradient">
        </div>
    </div>
    

    CSS

    #container {
        position:relative;
    }
    #contents {
        background:red;
    }
    #gradient {
        position:absolute;
        z-index:2;
        right:0; bottom:0; left:0;
        height:200px; /* adjust it to your needs */
        background: url(data:image/svg+xml;base64,alotofcodehere);
        background: -moz-linear-gradient(top,  rgba(255,255,255,0) 0%, rgba(255,255,255,1) 70%);
        background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,0)), color-stop(70%,rgba(255,255,255,1)));
        background: -webkit-linear-gradient(top,  rgba(255,255,255,0) 0%,rgba(255,255,255,1) 70%);
        background: -o-linear-gradient(top,  rgba(255,255,255,0) 0%,rgba(255,255,255,1) 70%);
        background: -ms-linear-gradient(top,  rgba(255,255,255,0) 0%,rgba(255,255,255,1) 70%);
        background: linear-gradient(to bottom,  rgba(255,255,255,0) 0%,rgba(255,255,255,1) 70%);
    }​
    

    This will work almost in any browser which supports opacity (including IE9), and here’s the IE8 “rgba” fallback (untested):

    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#ffffff',GradientType=0 );
    

    To generate your own gradient, visit Colorzilla.

    The first stop (0%) must have opacity 0 ( rgba(255,255,255,0); ), then around 70% – do some tests to find what’s good for you – add another stop with opacity 1 ( rgba(255,255,255,1); ).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Trying to get tables next to each other horizontal I have two
Possible Duplicate: How to parse and process HTML with PHP? I'm trying to scrape
Possible Duplicate: std::string and its automatic memory resizing I am just curious, how are
Possible Duplicate: Unable to get a list of installed Python modules How do I
Possible Duplicate: Why not use tables for layout in HTML? Under what conditions should
Possible Duplicate: Javascript window resize event I want to get an event which is
Possible Duplicate: PHP get all arguments as array? Within a javascript function arguments always
Possible Duplicate: How can I combine multiple rows into a comma-delimited list in Oracle?
Possible Duplicate: nth-child for every two table rows I'm trying to work my way
Possible Duplicate: Get the size of a list in python? I need to be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.