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

  • Home
  • SEARCH
  • 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 6019669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:27:18+00:00 2026-05-23T03:27:18+00:00

I have two elements on a page. One being the main content container and

  • 0

I have two elements on a page. One being the main content container and the next one a sidebar. What I am trying to do is have it so that the sidebar is aligned to the far right ALL the time – meaning on the right of the screen no matter the screen resolution and the content container should be more or less in the middle of the page.

I have a main container that holds them both.

First thing that I tried was using absolute positioning on the sidebar but this didn’t work as when the resolution changed the sidebar would overlap the content.

For interests sake the content box is 632px & the sidebar is 272px.

So next thing I tried was floating each of these elements to the right & using a margin-left “percentage” of 10%. This obviously stopped the overlapping; however now when the resolution gets smaller to the point that it can’t contain the content element, the margin & the sidebar the content element now drops below the sidebar content.

So I was wondering if there was anyway that I could make it so the screen would get bigger and utilize horizontal scroll bars instead of making the content drop below the sidebar?

  • 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-23T03:27:18+00:00Added an answer on May 23, 2026 at 3:27 am

    In order to implement my solution to your problem, you’re going to need to modify your HTML a little:

    <div id="container">
        <div id="main">
        ...
        </div>
    </div>
    <div id="sidebar">
       ...
    </div>
    

    CSS:

    * { margin: 0; padding: 0; } /* Or your favorite CSS reset to ensure that your body/html tag has no margin or padding */
    #container { float: left; width: 100%; margin: 0 -272px 0 0; }
    #main { float: right; width: 632px; }
    #sidebar { float: right; width: 272px; }
    

    I created a fiddle to show you what I’ve posted (Note that I modified the values so that it would fit in the tiny preview screen).

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

Sidebar

Related Questions

We have a page that ordinarily has two elements arranged side-by-side. Despite exploring a
I have two STL containers that I want to merge, removing any elements that
I have two elements: <input a> <input b onclick=...> When b is clicked, I
I have two elements (a button and an anchor tag) both with a dynamical
I have two arrays containing the same elements, but in different orders, and I
I have two applications written in Java that communicate with each other using XML
I have two classes, and want to include a static instance of one class
In my web application I have a user profile page. That page has these
I am trying to write an MVC webpage that has two drop down lists.
I have two arrays of animals (for example). $array = array( array( 'id' =>

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.