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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:57:30+00:00 2026-05-17T23:57:30+00:00

So here is my CSS problem with IE 8. I have a parent div

  • 0

So here is my CSS problem with IE 8.

I have a parent div and 2 child div. I want the parent divs width to be increased based on the width of the inner -child div’s. It works well in Firefox, but in IE8, the first child div’s width going to the entire page width when I have a float:right for the inner element of that div.

My HTML markup

<div class="divPageContainer">   
    <div id="pnlOrderOptions" class="pnlOrderOptions">      
        <div class="divOrderOptions">      
            some content           
        </div>    
    </div>
    <div class="divOrderDetails" id="pnlOrderDetails">
        <div style="height:20px;width:800px;border:3px solid red;padding:2px;">this width of this red box can be vary from 100 to 1000</div>
    </div>
</div>

and the CSS

.divPageContainer  
 { width:auto; 
   float:left; 
   margin-left:8px;
   height:auto;
   border:1px solid black;
 }
 .pnlOrderOptions 
 {
   min-height:10px; 
   height:auto;
   overflow:auto;
   margin-top:30px; 
   border:1px solid orange;
   width:auto;
 }
 .divOrderOptions 
  {
    margin-left:7px; 
    font-family:Verdana;
    font-size:12px; 
    width:400px; min-height:10px;height:auto;
    border:1px solid #858A8D;
    float:right; padding:5px;
    background-color:#F0F6F8;
  }
  .divOrderDetails 
  { 
    float:left; 
    margin-top:4px;padding:3px;
    border:2px solid blue;
    min-height:10px;height:auto;
  }

It works well in Firefox; here it is:

alt text

And in IE I am getting (I reduced the red bordered divs width to 400 from 800 to get a good snapshot because my monitor is a wide one )

alt text

One thing I noticed is that this problem came when I deploy this as a intranet web application. It works well in local development machine. I remember some IE7 compatibility problem used to appear when we deploy sites to intranet.

The ultimate result I am looking for is the div with content “somecontent” here should be the right most side (not to the page but based on the width of the second div, which will change dynamically) ie it should behave like my Firefox screenshot.

  • 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-17T23:57:31+00:00Added an answer on May 17, 2026 at 11:57 pm

    The float right thing is a known bug in IE and FX 2.

    Can you use display:inline-block; instead? There is a way to get it to work on non-inline elements for IE.

    EDIT: You’d have to set text-align:right on the parent of the inline-block.

    EDIT #2: Here is an example of the fix I was talking about: http://work.arounds.org/sandbox/64/run

    Please let me know if this isn’t what you need or if it doesn’t work for you.

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

Sidebar

Related Questions

I'm getting an error here that says I haven't defined a method, but it
This is beyond both making sense and my control. That being said here is
Let say I have the following desire, to simplify the IConvertible's to allow me
I have found this example on StackOverflow: var people = new List<Person> { new
IE is giving me an undefined NAN when i try to view the calender...
I would like to remove/delete a migration file. How would I go about doing
I am writing a query to fetch results for all the values in a
There doesn't seem to be any tried and true set of best practices 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.