<div id="main" style="height:auto; border:5px solid #000000">main <div id="sub1" style=" height:200px; background-color:#FF0000;">sub1 <div id="sub2" style=" width:100px; height:200px; background-color:blue;">sub2 inside sub1 </div> </div> </div> in the above code main div contains sub1 and sub1 contains sub2.... the height auto given for main works for the immediate div ie, sub1 and if we increase the size of sub2 the hieght auto given for main does not work main thing is that the sub1 and sub2 cant be changed its automaticaly generated code , and main div is only in our control... i tryd table giving height auto instead of main div but i doesnt works and genius can solve the prob?
what are you trying to accomplish ? i still don't understand... do you mean that the "main" height will fit the monitor ? or else ?
no erceex that sub1 and sub2 is automaticaly generated div, we have no control in that it will be generated div inside lots of div........ the main div is in our control....] height auto given for main div works for sub1 if we increase it.... but height auto given for main div does nott work for sub2 when we increase sub2 s height
i still dont get it... everything looks right, just, what are you trying to accomplish ? do you want that the "main" div get tall 100% ? or what ? because the auto height will fit the height of the content. do you have any site reference ?
not i dont have........but in ma code sub1 and sub 2 div cannot be changed at all coz it is auto generated and its not in ma hand...................................... we can change only the main div..... but if we increase the size of sub2 div .......... it gets out of the main div..
see this image u can understand sub2 comes out off main div thats the black border..but sub1 has no prob its still inside main if we increase its size
Emm... Maybe I could help you. Just try. Not quite understand what do you mean by sub1 and sub2 which are automatically generated. Anyway, can you change the size in sub1 since you can increase the size in sub2? Like this:
no cant even touch sub1 and sub2 ,,,,, i have included sub1 and sub2 to juz to explain the way how the automaticaty generated code will be, it will be div inside div
It seems there is no way we would just modify div main to make div sub2 to be fitted into div main. As the value auto in attribute height for div main is depending on the height of its immediate level, i.e. div sub1. So that's why the value in attribute height for sub1 also need to be set to auto to make use of the height value from sub2. May be I may need to know how your automatic generated code look like? Since it's div within div, so there could be a way to modify the second div.