![]() |
| ||
| div does not inherit correct width I have some nested divs which user percentages for sizing the width. The divs are floated for positioning which works fine. The problem is that one of the divs (sub-content) which contains two floated divs sized at 35% and 65% does not occupy the same width as the divs above and below it, resulting in the border being out of line with everything else. this is what it looks like in firefox: http://www.tracethisbook.com/images/firefox.tiff and here's what it should look like, as displayed in safari http://www.tracethisbook.com/images/safari.tiff The relevant code is below. I've included a few small bits of inline styling as well as relevant CSS so I didn't have to include all of the CSS files. <div class="content"> I think I've including everything above. Does anyone have any idea why this renders fine in Safari, but not in Firefox. Also, in Opera, the trace_details and book_details divs render with their smallest possible widths and the border on the sub_content div is even further out of line. Any help would be greatly appreciated. Thanks, Kev |
| ||
| Re: div does not inherit correct width First things first. You dont have "#" before your colours. Secondly, the tracy_details class, min-width, does not have a unit. To be totally honest i can't see what is going on, i would help you, if you get setup some bg colours and some content holders just to make it a little clearer. |
| ||
| Re: div does not inherit correct width Remove padding from .internal_content and add padding-left:10px to .sub_header |
| ||
| Re: div does not inherit correct width You forgot that margins, borders, and padding are added OUTSIDE the width and height styles. This makes the inner objects too big to fit in your container if the width percentages add to 100%. |
| ||
| Re: div does not inherit correct width 1) Remove the "float:right" from the sub_content div to get it to fill the width of the internal_content div. 2) Add a "float:right" to the trace_details list to get this to position properly (which you have as an ID and should change to a class as previously mentioned.) I'm assuming this is the div containing the "location, reader, rating, etc." content. 3) When I do this, I still see that the divs contained by the sub_content div flow outside of aub_content boundaries (not sure if you see this with the content present and whatever DOCTYPE you are using.) Adding an "overflow:auto" to the sub_content div keeps these contained divs from flowing outside of the box. Here is modified code. Took out the images and substituted background colors & labeled the divs so that the whole thing is easier to see. Let me know if this helps. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" |
| All times are GMT -4. The time now is 2:43 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC