Set the width of all p elements:
The width() method sets or returns the width of the selected element.
Returns the width of the FIRST matched element.
Sets the width of ALL matched elements.
| Parameter | Description |
|---|---|
| value | Required. Specifies the width in px, em, %, etc. Default unit is px |
Using a function to set the width of ALL matched elements.
| Parameter | Description |
|---|---|
| function(index,oldwidth) | Specifies a function that returns the new width of selected
elements.
|
Get
the width of the document and window elements
How to use the width() method to get the current width of the document and window
elements.
Set
the width using em and % values
How to set the width of an element using other length units.
| 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 |
|---|
| XML Editor - Free Trial! |
| 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 |
|---|