Default behavior
* {
margin: 0;
}
html,
body {
height: 100%;
}
div {
width: 10rem;
height: 10rem;
background-color: #333;
position: absolute;
left: 25%;
}
<div></div>
When the window is resized the div remains 25% from the left edge of it's container.
Can we increase or give the illusion of the percentage value of the left property increasing as the window's width is decreased?
Edit: Is this possible without using 1000 media queries or JavaScript while keeping a smooth, consistent, un-jittery transition?
I've actually achieved this effect with pure CSS a long time ago but forgot how it was done. My code was kind of convoluted and used a lot of percentages for widths and absolute positioning. But I know it's possible. Looking for a CSS hack at the very least.
