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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:17:54+00:00 2026-05-25T22:17:54+00:00

I have a problem that I thought was pretty simple but that is taking

  • 0

I have a problem that I thought was pretty simple but that is taking me a lot of time to solve it. If there is a simple solution (and I don’t know CSS enough), please point me there and I’ll close this question immediately.

My problem is the following.

I have 6 divs one on top of another, something like:

<div id="header">header content</div>
<div id="sidebar1">sidebar1 content</div>
<div id="maincontent">maincontent content</div>
<div id="maincontent2">maincontent2 content</div>
<div id="sidebar2">sidebar2 content</div>
<div id="footer">footer content</div>

What I want to have is something like:

-----------------------------------------------------------
| header content                                          |
-----------------------------------------------------------
--------------------------------------  -------------------
| maincontent content                |  | sidebar1 content|
|                                    |  -------------------
|                                    |  -------------------
|                                    |  | sidebar2 content|
|                                    |  -------------------
--------------------------------------
--------------------------------------
| maincontent2content                |
|                                    |
|                                    |
|                                    |
|                                    |
--------------------------------------
-----------------------------------------------------------
| footer content                                          |
-----------------------------------------------------------

In other words, is there a way to create a right column even if the divs are not one after another using only CSS and without moving the divs in the code?

I tried to use for sidebar1 the following css

 position:absolute;
 top:3em;
 right:0;

and for sidebar2 the following css

 position:absolute;
 top:9.5em;
 right:0;

but I have the impression that this is not the right way to do it.

A simple way could be to define the top attribute size as a function of the height of heather, but I couldn’t find any way to do it only with CSS.

Thanks!

  • 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-25T22:17:54+00:00Added an answer on May 25, 2026 at 10:17 pm

    Well… as a direct answer to your question, you can use a combination of floats and % widths to accomplish this. You can also use fixed widths, but you’ll have to determine what those sizes are. Here’s a simple implementation:

    Demo


    CSS

    #maincontent
    {
        float:left;
        width:70%;
        background:#ee5;
    }
    
    #sidebar2,#sidebar1
    {
        float:right;
        width:30%;
        background:#5e5;
    }
    
    #footer
    {
        clear:both;
        background:#5ee;
    }
    
    #header
    {
        background:#55e;
    }
    

    HTML

    <div id="header">header content</div>
    <div id="sidebar1" class="side">sidebar1 content</div>
    <div id="maincontent">maincontent content</div>
    <div id="sidebar2" class="side">sidebar2 content</div>
    <div id="footer">footer content</div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have what I thought was a pretty simple area of my webpage, but
(I have a problem that I illustrated in this question but had no correct
I've got a question that probably has a pretty simple answer, but I didn't
My problem is pretty simple; I have text file filled with double precision floating
I'm a beginner in Python. My problem is pretty simple. I have a string
I have the following problem and I'm pretty bad at CSS, but good at
I have a problem of web pages being cached even though I specify that
In a couple of scripts that I use I have problem that is intermittent.
I have a problem that confuses my users, being that although an item is
I have the problem that an specific step in Ant can only be executed

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.