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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:25:30+00:00 2026-05-16T02:25:30+00:00

I’m trying to achieve this effect with css3: The HTML code is cleanly something

  • 0

I’m trying to achieve this effect with css3:

header/main

The HTML code is cleanly something like

...
<header>
    ...
</header>

<div id="wrapper">
    ...
</div>
...

and the css is, for the moment, something like

header {
    display: block;
    width: 900px;
    height: 230px;
    margin: 0 auto;
    border: 1px solid #211C18;
    ...
    box-shadow: 2px 4px 20px #005377;
    -moz-box-shadow: 2px 4px 20px #005377;
    -webkit-box-shadow: 2px 4px 20px #005377;
}

#wrapper {
    width: 820px;    
    margin: 0 auto;
    ...
    border-right: 1px solid #211C18;
    border-bottom: 1px solid #211C18;
    border-left: 1px solid #211C18;
    ...
    box-shadow: 2px 4px 20px #005377;
    -moz-box-shadow: 2px 4px 20px #005377;
    -webkit-box-shadow: 2px 4px 20px #005377;
}

In order to obtain the desired result, I need to:

  1. Hide the top shadow of the main div (no problem with that)
  2. Bring header’s bottom shadow in front of the main div, and not behind as it is right now.

I’ve been reading a lot about box-shadow, and I haven’t found a solution that really pleases me…
Any idea?

  • 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-05-16T02:25:31+00:00Added an answer on May 16, 2026 at 2:25 am

    This jsfiddle does what you want.

    The way it works is with a main #wrap element that centres the content and creates a coordinate map for the absolutely positioned #main element. It does this because of its position: relative CSS rule. You end up with the following markup:

    <div id="wrap">
        <header></header>
        <div id="main"></div>
    </div>
    

    The header is then placed inside of this and given position: relative and a z-index to set it stacking above the #main container.

    Finally #main is absolutely positioned below the header. The CSS looks like so:

    /* centre content and create coordinate map for absolutely positioned #main */
    #wrap {
        width: 300px;
        margin: 20px auto;
        position: relative;
    }
    
    header, #main {
        background: #fff;
    
        /* rounded corners */
        border: 1px solid #211C18;
        border-radius: 5px;
        -moz-border-radius: 5px;
        -webkit-border-radius: 5px;    
    
        /* dropshadows */
        box-shadow: 2px 4px 20px #005377;
        -moz-box-shadow: 2px 4px 20px #005377;
        -webkit-box-shadow: 2px 4px 20px #005377;
    }
    
    header {
        display: block;
        width: 300px;
        height: 50px;
    
        /* stack above the #main container */
        position: relative;
        z-index: 2;
    }
    
    #main {
        width: 200px;
        height: 70px;
    
        /* stack below the header and underlap it...if that's even a word */
        position: absolute;
        z-index: 1;
        top: 40px;
        left: 50px;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have some data like this: 1 2 3 4 5 9 2 6

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.