How to get “position:fixed” css to work in IE 7+ with TRANSITIONAL doctype?

前端 未结 2 1427
猫巷女王i
猫巷女王i 2020-11-27 21:11

I know that position:fixed; was not supported by IE until IE 7, and it only works in IE 7 if you have a STRICT DOCTYPE.

My question is: \"

2条回答
  •  渐次进展
    2020-11-27 21:52

    You don't need a Strict DOCTYPE for fixed support. You only need a DOCTYPE that triggers Standards Mode (or ‘almost standards’). That can be a transitional doctype such as:

    
    

    or XHTML:

    
    

    as long as the system ID (the URI at the end) is included.

    If your pages really are relying on Quirks Mode (ugh!), I'm sorry but you cannot use fixed and will have to resort to JavaScript hacks (but then you might need those for IE6 anyway).

提交回复
热议问题