jQuery HTMLLesson 19Free preview
jQuery css()
This lesson is part of jQuery · All levels
Summary
The css() method is used to read or set the direct style property on selected elements. When given one property name, css() returns its value; when given two arguments, css() sets a new style. You can also send objects containing multiple properties at once to make them more efficient.
Key points
- Returns the value of the property of the style
- Css(prop, value) sets one property of the style
- Css({prop: value, ...}) sets many properties at once
- The numerical value for a particular property can be written without a unit
- Style directly across the style of the stylesheet
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.