The best way of checking for -moz-border-radius support

前端 未结 7 449
日久生厌
日久生厌 2021-01-02 04:54

I wanted some of those spiffy rounded corners for a web project that I\'m currently working on.

I thought I\'d try to accomplish it using javascript and not CSS in a

7条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-02 05:01

    Why not use -moz-border-radius and -webkit-border-radius in the stylesheet? It's valid CSS and throwing an otherwise unused attribute would hurt less than having javascript do the legwork of figuring out if it should apply it or not.

    Then, in the javascript you'd just check if the browser is IE (or Opera?) - if it is, it'll ignore the proprietary tags, and your javascript could do it's thing.

    Maybe I'm missing something here...

提交回复
热议问题