Min-width in MSIE 6

前端 未结 11 1462
一生所求
一生所求 2020-12-16 05:35

What is the definitive way to mimic the CSS property min-width in Internet Explorer 6? Is it better not to try?

11条回答
  •  一生所求
    2020-12-16 06:21

    You could use an expression (as suggested by HBoss), but if you are worried about performance then the best way to do this is to add a shim inside the element you want to apply a min-width to.

    The "shim" div will hold the container div open to at least 500px! You should be able to put it anywhere in the container div.
     
    #container .shim { width: 500px; height: 0; line-height: 0; }

    This requires a little non-semantic markup but is a truly cross-browser solution and doesn't require the overhead of using an expression.

提交回复
热议问题