Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set element width or height in Standards Mode

People also ask

When you set the width and height properties of an element with CSS you just set the width and height of the?

Important: When you set the width and height properties of an element with CSS, you just set the width and height of the content area. To calculate the full size of an element, you must also add padding, borders and margins.


Try declaring the unit of width:

e1.style.width = "400px"; // width in PIXELS

The style property lets you specify values for CSS properties.

The CSS width property takes a length as its value.

Lengths require units. In quirks mode, browsers tend to assume pixels if provided with an integer instead of a length. Specify units.

e1.style.width = "400px";