Width and Height Examples

Setting the Width

The width of this <p> element is set to 400 pixels.

The width of this <p> element is set to 50% the width of the screen.

Setting the Height

The height of this <p> element is set to 200 pixels.


Click to validate the HTML code

Click to validate the CSS code