Home >Web Front-end >JS Tutorial >Firefox div height adaptive_javascript skills

Firefox div height adaptive_javascript skills

WBOY
WBOYOriginal
2016-05-16 18:53:441020browse

1. If you want a minimum height for a div, you should use the minheight attribute of CSS, but IE does not support it. Considering that most users use IE, this attribute is generally discarded. In IE, height can basically be used as minheight, because if the content exceeds height, IE will adapt to its height. But once the height is set, FIrefox will not adapt to the height of the div. So I can only use both attributes and simply write

Jimbor Studio
.

2. Even if a fixed height is not set, Firefox’s height adaptation is not satisfactory. If you need to nest a layer within a layer that requires float to specify, then it fails again. In fact, the simplest way is to add a clear:both div at the bottom of the div. For example:

Copy code The code is as follows:


Jmedia Design

www.jmedia.cn





3. There is also a js solution that can be seen.
Copy code The code is as follows: