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 8460651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:40:00+00:00 2026-06-10T13:40:00+00:00

I’m trying to figure out if this is possible with css. I want a

  • 0

I’m trying to figure out if this is possible with css. I want a square that has a drop shadow. At the bottom of the square, the drop shadow is completely visible. At the top of the square, no drop shadow should be apparent. This would be a gradient so being in between the top and bottom, the drop shadow would be half visible.

Any ideas on how to achieve this?

  • 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-10T13:40:02+00:00Added an answer on June 10, 2026 at 1:40 pm

    It is possible to emulate that using a gradient on an absolutely positioned pseudo-element, with a z-index such that it appears underneath its parent element.

    HTML:

    <div class='e'></div>
    

    CSS:

    .e {
        position: relative;
        width: 10em;
        height: 10em;
        margin: 1em;
        background: lemonchiffon;
    }
    .e:before {
        position: absolute;
        z-index: -1;
        top: 10%; left: 10%;
        width: 100%;
        height: 100%;
        background: linear-gradient(transparent, navy);
        content: '';
    }
    

    If you want the shadow to have a faded edge, then you’ll have to give the pseudo-element an inset shadow (same colour as the background of .e‘s parent).

    box-shadow: inset 0 0 .5em .5em white;
    

    Note that this won’t work in IE9 and older. You can use filter gradients for those, but not on pseudo-elements, so what you would have to do in this case would be to add a child to the element (just for IE) and style it just like you style the pseudo-element.


    EDIT: If you want this to work over an image, gradient background, then I’m afraid it’s a bit trickier and it cannot be done using just CSS in IE9 and older. However, in the current versions of the other browsers, this can be achieved using a linear gradient and three radial gradients.

    Relevant CSS:

    .e {
        width: 25em; /* give it whatever width and height you like */
        height: 25em;
        /* make padding on right and bottom larger by adding the amount taken by
         * the "shadow"
         */
        padding: 5% 10% 10% 5%;
        box-sizing: border-box;
        /* change navy to red in each of these at one time to see what each
         * gradient covers
         */
        background:radial-gradient(at top right, navy, transparent 70.71%) 0 100%,
            radial-gradient(at top left, navy, transparent 70.71%) 100% 100%,
            radial-gradient(at bottom left, navy, transparent 70.71%) 100% 0,
            linear-gradient(navy, transparent) 50% 100%;
        background-repeat: no-repeat;
        background-size: 95% 95%, 5%, 5%, 5% 95%, 90% 5%;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I know there's a lot of other questions out there that deal with this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Basically, what I'm trying to create is a page of div tags, each has
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I'm trying to create an if statement in PHP that prevents a single post

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.