Div doesn't stretch to content in IE8/Chrome

Discussion in 'CSS' started by devnl, Aug 8, 2009.

  1. #1
    Hi,

    I'm currently in the process of developing a website which uses rounded corners. This is accomplished by using the technique described here. It looks like this technique works, at least in IE7, but when I check it in IE8 or Chrome the content doesn't stretch the div out.

    I would also like to note that in IE6 for some reason the right side doesn't render correctly. If I strip the box of it's current content and just put in some plain text it has no problem rendering correctly. What am I doing wrong here? Any help on how to fix this/improve the code I'm using are more then welcome.

    You can find the site here:
    http://www.dvolve.org/ms/test/test.htm

    Thanks in advance!

    -devnl
     
    devnl, Aug 8, 2009 IP
  2. Spawny

    Spawny Well-Known Member

    Messages:
    252
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    110
    #2
    apply overflow:hidden to .mainbody

    
    .mainbody {
    	background-color: #fff;
    	width: 890px;
            overflow:hidden;
    }
    
    
    Code (markup):
     
    Spawny, Aug 8, 2009 IP
  3. devnl

    devnl Guest

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks, that did the trick on the content not stretching the box out, any idea about the IE6 right side not rendering? And how would I go about aligning the comments (div with class bodycomments) box to the right? Floating doesn't seem to do the trick for me.
     
    devnl, Aug 8, 2009 IP
  4. Spawny

    Spawny Well-Known Member

    Messages:
    252
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    110
    #4
    it wont float to the right because you're assigning a 100% width to (.bodycomments)...try changing the witdh to another value ... i suggest you add another div to hold each post i.e

    
    <div class="post"><!-- apply your border bottom to this div : add overflow:hidden; -->
         <span class="dateHeader">{DATE}</span>
         <h2>{SOME TITLE}</h2>
         <div class="bodycomments">
         {COMMENTS}
         </div>
    </div>
    
    Code (markup):
     
    Spawny, Aug 8, 2009 IP
  5. devnl

    devnl Guest

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks again! Now all that's left is the IE6 right border :)
     
    devnl, Aug 8, 2009 IP
  6. myst_dg

    myst_dg Active Member

    Messages:
    224
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    58
    #6
    I checked your site, add this to your style-ie6.css
    .dialog .bd .c .s {
    	margin-right:33px;
    }
    Code (markup):
     
    myst_dg, Aug 8, 2009 IP