jQuery has one important method for CSS manipulation: css()
The css() method has three different syntaxes, to perform different tasks.
Use css(name) to return the specified CSS property value of the FIRST matched element:
Use css(name,value) to set the specified CSS property for ALL matched elements:
Use css({properties}) to set one or more CSS property/value pairs for the selected elements:
jQuery has two important methods for size manipulation.
The height() method sets the height of all matching elements:
The width() method sets the width of all matching elements:
| CSS Properties | Description |
|---|---|
| $(selector).css(name) | Get the style property value of the first matched element |
| $(selector).css(name,value) | Set the value of one style property for matched elements |
| $(selector).css({properties}) | Set multiple style properties for matched elements |
| $(selector).height(value) | Set the height of matched elements |
| $(selector).width(value) | Set the width of matched elements |
For a full jQuery CSS reference, please go to our jQuery
CSS Methods Reference.
The perfect solution for professionals who need to balance work, family, and career building.
More than 10 000 certificates already issued!
The HTML Certificate documents your knowledge of HTML.
The CSS Certificate documents your knowledge of advanced CSS.
The JavaScript Certificate documents your knowledge of JavaScript and HTML DOM.
The jQuery Certificate documents your knowledge of jQuery.
The XML Certificate documents your knowledge of XML, XML DOM and XSLT.
The ASP Certificate documents your knowledge of ASP, SQL, and ADO.
The PHP Certificate documents your knowledge of PHP and SQL (MySQL).
| WEB HOSTING |
|---|
| Best Web Hosting |
| PHP MySQL Hosting |
| Best Hosting Coupons |
| UK Reseller Hosting |
| Cloud Hosting |
| Top Web Hosting |
| $3.98 Unlimited Hosting |
| Premium Website Design |
| WEB BUILDING |
|---|
| Download XML Editor |
| FREE Website BUILDER |
| Best Website Templates Top CSS Templates |
| CREATE HTML Websites |
| EASY WEBSITE BUILDER |
| W3SCHOOLS EXAMS |
|---|
|
Get Certified in: HTML, CSS, JavaScript, XML, PHP, and ASP |
| W3SCHOOLS BOOKS |
|---|
|
New Books: HTML, CSS JavaScript, and Ajax |
| STATISTICS |
|---|
|
Browser Statistics Browser OS Browser Display |
| SHARE THIS PAGE |
|---|