How to maintain the proportions of an SVG across different screen sizes? (1920x1080 / 1440x900/ ...)
I want the SVG to always stay in the same position with the wave touching the exclamation point. Can someone help me, please?
12 Replies
have you tried
aspect-ratio: 1093/630
?I tried, but it didn't work. I'm trying a different approach using grids, but I'm having trouble keeping the grid proportions at 50/50.
can you put this in a codepen or jsfiddle?
font-size: 0.520834vw; /* 1rem = 10px */
<-- that's not how it works ...i don't see what's wrong, it seems to work fine
I would like the image to shrink as the screen width gets smaller. For example, column 1, row 1 is always wider than column 2, row 1. I would like to know if there's a way for both to always use half of the current width.
Here is an example.
set max-width of 100% to the images, and change
grid-template-columns
to auto auto
for .hero
it won't give you exactly what you need, but it will get almost there
you might need to try with object-fit: cover
as wellThank you for the tips. I made some adjustments, but this problem appeared. Even using object-fit: cover, in extreme cases with a width greater than 2000 pixels, the images separate.
yeah, i saw that same thing happening