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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:22:28+00:00 2026-05-26T21:22:28+00:00

I have the following 4 divs with the CSS below. The problem is, the

  • 0

I have the following 4 divs with the CSS below. The problem is, the border on the red span draws over the others. How can I avoid this? I tried adding margins to spanRed, even negative margins, neither of which worked.

http://jsfiddle.net/eh9rM/

Bonus points This doesn’t work in IE (8,9 tested) at all… only the blue div shows up. 🙂

<div id="spanBlue"></div>
<div id="spanGreen"></div>
<div id="spanOrange"></div>
<div id="spanRed"></div>


#spanBlue      {position: fixed;
                top: 0px; left: 0px;
                height: 100%;
                width: 10%;
                background-color: #4D9DB8;
                border-right: 10px solid #045B6F;
                z-index: 1;}    

#spanGreen     {position: fixed;
                top: 0px; left: 0px;
                height: 10%;
                width: 100%;
                background-color: #A4AC79;
                border-bottom: 10px solid #34655F;
                z-index: 1;}    

#spanOrange    {position: fixed;
                top: 0px; left: 0px;
                height: 10%;
                width: 10%;
                background-color: #FA9D26;
                border-right: 10px solid #045B6F;
                z-index: 2;}         

#spanRed       {position: fixed;
                bottom: 0px; right: 0px;
                height: 90%;
                width: 90%;
                background-color: WHITE;
                margin-top: 20px;
                margin-left: 20px;
                border-top: 10px solid #B52024;
                border-left: 10px solid #B52024;
                z-index: 3;}     
  • 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-26T21:22:29+00:00Added an answer on May 26, 2026 at 9:22 pm

    You have two options:

    1. Add div { box-sizing: border-box }. This switches the elements to the ‘traditional’ model, where borders and paddings are included in the width (supported from IE8+)
    2. Use the Flexible Box model (IE10+)
    3. Add the borders as pseudo-elements (IE8+)

    Using pseudo-elements (remove the border from #spanRed):

    #spanRed:after {
        content:' ';
        display:block;
        position:absolute;
        left:0;
        top:0;
        right:0;
        bottom:0; 
        border:4px solid red;
    }
    

    Bear in mind that using position:fixed as the basis for a layout is very fragile.

    edit: if you need IE7 support, add the extra element via JS:

    $('#spanRed').append('<span class="after" />')
    

    Then reference it in the CSS. Be aware that you have to repeat the whole style, you can’t use both selectors together otherwise IE7 ignores the rule.

    Or, since these are all “useless” elements anyway, just add it to the HTML:

    <div id="spanRed">
       <span class="inner"></span>
    </div>
    

    Here’s your code using that: http://jsfiddle.net/eh9rM/2/

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

Sidebar

Related Questions

I have the following CSS .streamBox { font-size:12px; background-color:#EDEFF4; border-bottom:1px solid #E5EAF1; margin-top:2px; padding:5px
Here's the link: http://www.iancreates.com/3dbikefit/ The divs .pod have the following CSS: .pod { background-color:
So let's say I have the following in 'foo.css': .border { border : solid
I have the following code snippet embedded into some of my divs so when
I have a page with the following two divs: <div id=searchResults> </div> <div class=postSearchOptions
i have the following jquery code. basically i will have several overlapped divs and
I have the following script: Timer=0; function countdown(auctionid){ var auctions; var divs; Timer=Timer+1; if((Timer%10==0)||(Timer==1)){
I have Divs show and hide (with an animation) using the following script (I
I have a repeater that outputs divs like the following for every item returned
I have a page with two divs on it. This page looks like the

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.