How to workaround: IE6 does not support CSS “attribute” selectors

前端 未结 7 961
青春惊慌失措
青春惊慌失措 2020-12-18 22:21

One of the projects which I am working uses CSS \"attribute\" selector [att]

CSS Selectors

which is not supported by ie6: Support for CSS selectors in IE6 (

7条回答
  •  粉色の甜心
    2020-12-18 23:21

    If you want attribute selector in IE6, you can use Dean Edward IE.js. http://dean.edwards.name/IE7/

    That will make IE 5+ behave much more like IE7

    supports the following CSS selectors: 
    parent > child
    adjacent + sibling
    adjacent ~ sibling
    [attr], [attr="value"], [attr~="value"] etc
    .multiple.classes (fixes bug)
    :hover, :active, :focus (for all elements)
    :first-child, :last-child, only-child, nth-child, nth-last-child
    :checked, :disabled, :enabled
    :empty, :contains(), :not()
    :before/:after/content:
    :lang()
    

    I didn't have IE6 (use IE7) so i can't said it worked, but give it a try

提交回复
热议问题