IE support for attribute selectors with HTML5 doctype

前端 未结 2 884
庸人自扰
庸人自扰 2021-01-24 08:58

w3school\'s chapter on attribute selectors states that:

IE7 and IE8 support attribute selectors only if a !DOCTYPE is specified.

IE7

2条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-24 09:14

    Your attribute selectors will still work.

    Although IE7 and IE8 don't understand that the HTML5 doctype means the document is HTML5, it by itself is still a doctype declaration, and they understand the syntax in general, so they will still render your page in standards mode.

    As long as you have some kind of doctype declaration in place, IE will (do its best to) render your page in standards mode, including supporting whatever CSS it supports.

提交回复
热议问题