How do you make a logo scale correctly on every screen size?

Make a logo responsive by limiting its width and letting its height follow the original ratio. A vector SVG is usually the cleanest source for a flat logo, while a transparent raster logo needs enough pixels for high-density screens. Set a maximum size so the logo does not dominate wide headers.
A useful baseline gives the image a fluid width with a cap. The header layout should reserve room for navigation and controls instead of shrinking the logo to an unreadable mark. Use a smaller approved logo variant when the full wordmark cannot fit, and keep its accessible name consistent.
.site-logo {
display: block;
width: clamp(7.5rem, 18vw, 12rem);
height: auto;
max-width: 100%;
}
Keep intrinsic width and height attributes on an img so the browser reserves space. Remove fixed CSS heights that force a different ratio. If the logo sits inside a fixed-height header, use max-height: 100% with width auto and enough padding. Do not use object-fit: cover because cropping a brand mark is rarely acceptable.
Test the logo with the longest navigation label, at 200 percent browser zoom and with system text enlargement. Check both a short phone and a narrow tablet. The logo should remain legible, the menu trigger should retain a usable target, and neither element should overlap when the header changes from horizontal to compact.
Raster logos can look blurry when the source is smaller than the rendered pixel demand. Provide density candidates through srcset or export a larger source, then compress it. SVG logos need an accurate viewBox and should not include large invisible margins. Inspect the actual graphic bounds when a correctly sized element still looks unexpectedly small.