Cssfloat compatible with Stylefloat browser

Source: Internet
Author: User

Reprinted from: http://zhangyaochun.iteye.com/blog/1603324

First of all, we should all know that for compatibility reasons, we will use this when we get the value of the float of the element.

Tidy up a full browser-compatible list today

Ie6-8 IE9 Ff Chrome Safari Opera
Stylefloat Y Y N N N Y
Cssfloat N Y Y Y Y Y
Float N Y N Y Y N

1. Float is the reserved word of ECMAScript

2,IE9 and WebKit series support [' Float '] way

3,IE under the way:

JS Code
    1. var test = document.getElementById ("test");
    2. Test.currentStyle.styleFloat; //Not set float returns none
    3. Test.style.styleFloat;

4, the other way:

JS Code
    1. var test = document.getElementById ("test");
    2. window.getComputedStyle (test,null). Cssfloat;
    3. Test.style.cssFloat;
    4. test.style[' float '];

Cssfloat compatible with Stylefloat browser

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.