开发者

Overriding previously set float using javascript in ie

I've read this question to figure out how to set 开发者_运维百科float:none on an element which already has float:right set with class.

I used element.style.cssFloat = "none", but this just added a new style property cssFloat which didn't over-ride the existing float:right. I've now fixed it using the adding/removing classes method.

But is there a way of over-riding existing float rules in ie without having to use classes?


Welcome to the wonderful world of non-standards.

Use cssFloat and styleFloat.

That said, using classes is the better approach. It keeps your presentation in the stylesheet instead of embedding it in the JavaScript.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜