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.
| WEB HOSTING |
|---|
| Best Web Hosting |
| PHP MySQL Hosting |
| Best Hosting Coupons |
| UK Reseller Hosting |
| Cloud Hosting |
| Top Web Hosting |
| $7.95/mo SEO Hosting |
| Premium Website Design |
| WEB BUILDING |
|---|
| XML Editor - Free Trial! |
| FREE Website BUILDER |
| Free Website Templates Free CSS Templates |
| Make Your Own Website |
| 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 |
|---|