1. if div wants a minimum height, the minheight attribute of css should be used, but IE does not support it. Considering that most users use IE, this attribute is generally discarded. In IE, the height can basically be used as minheight, because if the content exceeds the height, IE will adapt to its height. However, once the height is set, FIrefox will not adapt to the height of the div. Therefore, only two attributes are not needed, so you can write <div> Jimbor Studio </div> cleanly.
2. Firefox is not so adaptive to height even if it is not set to a fixed height. If you need to nest a layer that requires float, it will fail again. In fact, the simplest method is to add a clear: both div at the bottom of the div. For example:
Copy codeThe Code is as follows:
<Div>
<Div style = "float: left;"> Jmedia Design </div>
<Div style = "float: right;"> www.jmedia.cn </div>
<Div style = "clear: both;"> </div>
</Div>
3. You can also see a js solution.
Copy codeThe Code is as follows:
<Script type = "text/javascript">
<! --
Document. getElementById ("box"). style. height = document. getElementById ("right"). scrollHeight + 20 + "px"
-->
</Script>