Related onlineArticle, But none of them talk about ideas. I had this idea before, but I didn't write similar things myself. This time I made such a similar things. We can find that you can do it without looking at it.
After your own attempts, we found that there are two prerequisites:
1. This highly adaptive element is assumed to be a. It must have one or more sibling elements (nodes) and B;
2. Height (B)> height ().
If the above conditions are not met, there is no need for self-adaptation.
There are two things to do:
1. For the parent element (node) of A, if it is C, set: overflow-Y: hidden; // hide the part that may exceed
2. Set "A" to "margin-bottom:-2000px" and "padding-bottom: 2000px". // you can see that the calculated mode in the box mode is exactly offset by each other.
In this way, we can see the effect.
However, I found a problem:
1. in IE6, I used margin-left:-100% for layout. After using this attribute, I found that the location was incorrect and ran out of the screen. Corrected to: _ margin-left:-xxxpx; // The width of the main content of XXX.
Specific reference: http://www.positioniseverything.net/articles/onetruelayout/equalheight or Google: CSS adaptive height