Responsive/Fluid Design: Using Linear Interpolation for Layout
问题 I tried to do something similar to this: CSS Poly Fluid Sizing using calc(), vw, breakpoints and linear equations The wrapper shall span 100% for viewports of 600px and smaller. The wrapper shall span 70% for a viewport of 1800px. Interpolated values for all remaining viewports. This is what I came up with so far: #square1 { background-color: blue; margin: 10px 0; width: 100%; height: 50px; } #square2 { background-color: yellow; margin: 10px auto; width: calc(100% - 20 * (100vw - 600px)/40);