How to Write float attributes in css in JS

Source: Internet
Author: User

We all know that JavaScript is used to manipulate css attributes. style is usually used directly for css attributes that are not underlined. the property name, for example, obj. style. margin, obj. style. width, obj. style. left, obj. style. position. For css attributes that contain dashes, remove each dashes and replace the first character after each dashes with uppercase letters. For example, obj. style. marginTop, obj. style. borderLeftWidth, obj. style. zIndex, obj. style. fontFamily, etc. However, css has a special attribute, and its js usage is special. This special attribute is the float attribute.

If you follow the regular syntax, obj. style. float is incorrect. It will not take effect in any browser. Then how should we use js to write this attribute.

The correct usage method is as follows:

In ie:

Obj. style. styleFloat

Other browsers:

Obj.style.css Float

Articles you may be interested in
  • Three solutions for ineffective page refresh caused by Js, css, and images cached on webpages
  • Functions related to cookie operations in JavaScript
  • How to Use jquery. lazyload to dynamically delay page image loading
  • Php and mysql uft-8 Chinese encoding garbled several solutions
  • Div css book tutorials recommend "professional CSS + DIV webpage style and layout video tutorials"
  • Differences in the usage of tinyint, smallint, int, and bigint types in mysql
  • Edit the jQuery select drop-down box (add, delete, modify)
  • Solution to the DedeTag Engine Create File False error in dedeCMS

Related Article

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.