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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T09:13:18+00:00 2026-05-21T09:13:18+00:00

This is how my code may go:- <div id=parent style=width:49%> <div id=left style=float:left;clear:both;width:auto>BLAH!BLAH!Content goes

  • 0

This is how my code may go:-

<div id="parent" style="width:49%">
  <div id="left" style="float:left;clear:both;width:auto">BLAH!BLAH!Content goes here</div>
  <div id="right" style="float:left;clear:both:width:250px">Content again goes here!</div>
</div>

So basically I want left to auto-size based on the the width of “right” but must stay in limits of the “parent” container!

I looked up many places but didn’t find sensible answers! Hope this website can help me! 😀

Thanks in advance

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

    Float #right to the right, and do not float #left but give it a margin-right which is equal to the width of #right. If you float #left, it will take up the size of its contents, but if you don’t float it, it will take up the possible maximum width it can. And you just lower this maximum width by setting a margin.

    Demo

    Notice that in the markup I changed the order of divs:

      <div id="right">Content again goes here!</div>
      <div id="left">BLAH!BLAH!Content goes here</div>
    

    And the important part of the CSS:

    #parent { 
        width: /*whatever you need*/; 
        overflow: hidden; /* to let it take up the height of floated elements */
    }
    
    #left {
        margin-right: 250px;
    }
    
    #right {
        float: right;
        width: 250px;
    }
    

    Tested in FF4, Chrome, IE8.

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

Sidebar

Related Questions

I have a content editable div. Within this I am inserting a <pre>some code</pre>
I believe this code may require more effort to comprehend than average, so I'm
I stumbled upon this code and I am curious as to what use may
When i run this code the paintComponent method is not being called It may
As you may know, when we have this code in Javascript : function getName()
May I know what is the workaround to make this code passed, in Visual
I may be missing something obvious here, but how could I rewrite this code
I will be using some jQuery below this chunk of code (which I may
I have the following code: $(document).ready(function(){ $(.datepicker).each(function() { $(this).datepicker({ beforeShowDay: function(date){ return [$(this).parent().find(span.days).html(), ]
This code works fine...though it may be difficult to read. However I want to

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.