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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T09:10:00+00:00 2026-05-12T09:10:00+00:00

I know there are tons of articles all over Google on doing something similar

  • 0

I know there are tons of articles all over Google on doing something similar to this, but the problem is that they all vary on the implementation. What I’d basically like to do is have a single div of a fixed width be aligned to the center of my page, with bars on the side stylable to whatever I’d like. In Flex (MXML), I could easily make this happen with something like this:

<mx:HBox width="100%">
  <mx:VBox id="sideBarLeft" width="100%"/>
  <mx:Panel id="content" width="500"/>
  <mx:VBox id="sideBarRight" width="100%"/>
</mx:HBox>

This would give me a design that looks like this:

[sideBarLeft][content][sideBarRight]

The sidebars would expand as the screen area grows, but the content would stay the same, 500px wide.

How would I achieve this in HTML with divs and CSS?
Also, is there a way to set the minimum width of the sidebars? Ie: a size that they couldn’t shrink below? (for example: <mx:VBox id=”sideBarLeft” width=”100%” minWidth=”150″/>)

And I apologize for the nature of how much of a novice I am at this stuff. I guess I’ve spent too much time building applications and too little time with HTML and CSS 🙂

  • 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-12T09:10:00+00:00Added an answer on May 12, 2026 at 9:10 am

    Is there any particular reason you want to use div’s over table cells in this case?

    Regardless, I came up with a quick solution you might like:

    <html><head>
    <style type="text/css">
    *         { margin: 0; padding: 0; }
    body      { text-align: center; }
    #content  { width: 500px; height: 100%; margin: 0 auto;
                text-align: left; background: #DDDDDD; overflow: auto; }
    .column   { width: 50%; position: absolute; top: 0; height: 100%; }
    #leftcol  { margin-right: 250px; background: #AAAAAA; height: 100%; }
    #rightcol { margin-left: 249px; background: #AAAAAA; height: 100%; }
    </style>
    </head><body>
    <div class="column" style="left:0;">
    <div id="leftcol">This is the column on the left.</div>
    </div>
    <div id="content">Your content goes here.</div>
    <div class="column" style="right:0;">
    <div id="rightcol">This is the column on the right.</div>
    </div>
    </body></html>
    

    I really minified it to fit nicely on here, but copy and paste that into a file and tell me what you think.

    Just be forewarned: using tables is the preferred way to do this, and is perfectly acceptable. There is no problem mixing tables and divs, and styling/positioning tables with CSS. This solution is more of a “workaround”, but one thing is for sure – it works.

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

Sidebar

Related Questions

I know that there are tons of articles about this issue. But I'm struggling
I know there's already tons of similar questions, but I checked over twenty answers
So I know there are tons of questions similar to this but I havent
I know that there are tons of questions like this one, but I couldn't
I know that there are tons of questions like this on SO, but I
I know there are tons of threads regarding this issue but I have not
I know there have been tons of answers on this subject, but I still
OK, I know there are tons of questions like this, but for some reason
I know there was a TONS of similar quesitons here, but I've tried already
I know that there are tons of similar questions because I have read them

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.