元素 | 包裹实现 |
---|---|
浮动元素 | {width:auto;height:auto} |
静态内联元素 | === |
静态内联-块状元素 | {width:auto;height:auto} |
静态块状元素 | 竖直包裹:{height:auto;} |
表格元素 | {width:auto;height:auto} |
绝对定位 | 水平包裹:{width:auto;left:num;right:auto;}or {width:auto;right:num;left:auto;} 竖直包裹:{height:auto;top:num;bottom:auto;}or {height:auto;to:num;bottom:auto;} |
但在不同的浏览器下,宽高不一致。特别是在ie6浏览器下,一不小心浮动元素就超长换行了
所以呢,在ie6下,最好还是给一个固定的宽度。