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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:28:16+00:00 2026-06-12T13:28:16+00:00

I have three div layers inside of another larger one. Something like this: Image

  • 0

I have three div layers inside of another larger one. Something like this:

Image http://dev.kgstiles.com/wp-content/uploads/2012/10/Stack.png

Lets say the blue sections are the header and footer. What I currently have is the the green next to the top yellow div, but the bottom of the green div pushes the second yellow div down. I essentially have two divs next to each other then one div below both of them, but I want something more closely resembling the picture. What might I be missing that could put the green div next to both of the yellow ones?

I would post code exactly because there is a lot in each div, but I have something like:

<div class="container" >

<div id="greenDiv" style="float:right; padding-right:5%; padding-top:15px;">

</div>
<div id="topYellow" style="dsiplay:block;"> 

<-- Content -->
</div>
<div id="bottomYellow" style="dsiplay:block; float:left;"> 

<-- Content -->

</div>

What exactly do I need to do to keep the green div from pushing the bottom yellow one down? Any help would be greatly appreciated!

  • 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-12T13:28:17+00:00Added an answer on June 12, 2026 at 1:28 pm

    I would avoid using floats at all. If the green div has a fixed width, you could style them like this:

    .container {
        position: relative; /* or anything besides static */
    }
    
    #greenDiv {
        position: absolute;
        top: 0;
        right: 0;
        width: 100px; 
    }
    
    #topYellow, #bottomYellow {
        margin-right: 100px; /* Plus more if you want a gap */
    }
    

    Essentially, this takes the green div out of the “flow” of the container. The yellow divs will simply be placed with a normal flow, and their margin prevents them from overlapping the green div. You could alternatively just float #greenDiv and not #bottomYellow instead of using absolute positioning. The benefit to this is that in case #greenDiv is taller than the two yellow, then doing a clear: both on the footer should ensure that #greenDiv and the footer don’t overlap.

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

Sidebar

Related Questions

i have three divs like that: <div id=1 >id=1</div> <div id=2>id=2</div> <div id=3>id=3</div> Now
I am using jquery UI tabs I have three ajax tabs like so: <div
So I have three div's One parent and two child. The parent is as
what i have is this: <style> #main{position:relative; width:600px; height: 600px;} #cover{position:absolute} #image{position:absolute} </style> <div
I have some layers like so <div class=evenprop>some prop</div> <div class=evenprop>some prop2</div> <div class=evenprop>some
I have three divs, within a content div. Container width 70%. Within that I
I have three divs with float:left <div class=center> <div class=fade1></div> <div class=fade2></div> <div class=fade3></div>
my site has three div elements, header, content and footer. i have a picture
suppose I have a simple container which have three element: <div> <span>hello world</span> <input
I am new to dojo. I have three divs; the first div has 10

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.