Copyright © tutorialspoint.com

CSS - width

previous next


Description:

The width sets the width of an element's content area.

Possible Values:

Applies to:

All the HTML elements except non-replaced inline elements, table rows, and row groups.

DOM Syntax:

object.style.width="100px";

Example:

Here is the example:

<p style="width:400px; height:100px;border:1px solid red;
             padding:5px; margin:10px;">
This paragraph is 400pixels wide and 100 pixels high
</p>

This will produce following result:

This paragraph is 400pixels wide and 100 pixels high

To Become more comfortable - Do Online Practice


previous next

Copyright © tutorialspoint.com