Introduction to jquery css

Source: Internet
Author: User
Document directory
  • Operate CSS using jQuery
  • JQuery size Method

Operate CSS using jQuery
  • AddClass ()-add one or more classes to the selected Element
  • RemoveClass ()-delete one or more classes from the selected Element
  • ToggleClass ()-Adds or deletes the selected element to/from the switch operation.
  • Css ()-sets or returns one or more style attributes of the selected element.

JQuery css () method

<1> return CSS attributes

Css ("propertyname ");

<2> set CSS attributes

Css ("propertyname", "value ");

<2.1> set multiple CSS attributes

Css ({"propertyname": "value", "propertyname": "value ",...});
JQuery size Method

JQuery provides an important way to process multiple dimensions:

  • Width () sets or returns the width of an element (excluding the padding, border, or margin ).
  • Height () sets or returns the height of an element (excluding the padding, border, or margin ).
    Settings: $ ("# div1"). width (500). height (500); more: $ (window/document). width/height;
  • InnerWidth () returns the width (including the padding) of the element ).
  • InnerHeight () returns the height of the element (including the padding ).
  • OuterWidth () returns the width of the element (including the padding, border, and margin ).
  • OuterHeight () returns the height of an element, including the padding, border, and margin ).
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.