Properties
CSS
width
The width property specifies the content width of boxes generated by block-level and replaced elements.
width: <length> | <percentage> | auto | inherit
| Initial: | auto |
| Applies To: | all elements but non-replaced inline elements, table rows, and row groups |
| Inherited: | no |
| Percentages: | refer to width of containing block |
| Media: | visual |
Values
width: value;
| Value: | Description: |
| auto | Depends on the values of other properties |
| inherit | Takes the same computed value as the property for the element's parent |
| length | Width measurement: em | ex | px | in | cm | mm | pt | pc |
| percentage | Width percentage calculated with respect to the width of the containing block |
DOM
[window.]document.getElementById("element-id").style.width = "width";
