28Squishy SVG
II · Drawing with SVG
min-width lets the artwork squish gracefully instead of shrinking away.
Source
2 files<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>CodeSandbox</title>
</head>
<body>
<style>
.swoops-wrapper {
display: flex;
justify-content: center;
overflow: hidden;
}
.swoops {
width: 100%;
height: 200px;
min-width: 400px;
}
</style>
<div class="swoops-wrapper">
<svg
class="swoops"
preserveAspectRatio="none"
viewBox="0 0 780 151"
>
<!-- We’ll learn more about <path> elements shortly! -->
<path
d="M175 0.0551758C78 -1.94482 0 51.0553 0 51.0553V150.055H780V119.055C780 119.055 723 32.0551 585 38.0552C447 44.0553 429 84.0552 348 70.0553C267 56.0553 272 2.05518 175 0.0551758Z"
/>
</svg>
</div>
</body>
</html>