Understanding CSS Units
1. px (Pixels) Type: Absolute unit Definition: A fixed dot on the screen; consistent across all contexts Ideal for: Precise sizing—borders, small icons, when exact pixel values are essential 2. % (Percentages) Type: Relative to parent container Definition: A percentage of the parent’s dimension Ideal for: Fluid layouts—e.g. width: 50% ensures element fills half its container 3. em Type: Relative