CSS Height/Width

Setting Dimensions

Use width and height to define element size.

Percentage vs. Fixed Values

Use fixed values (px) for precise control and percentages (%) for responsive layouts.

Examples

div { width: 300px; height: 200px; }

img { width: 100%; height: auto; }