views:

86

answers:

1

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?

+1  A: 

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.

David Dorward
Aaargh - it never ends - layer upon layer of treating ie differently. The only reason I need to remove float in the first place is because ie won't adjust the element width when new content is added, the only reason I can't use setAttribute to adjust float, clear etc in one go is because ie doesn't like it... and on it goes.
wheresrhys