I'd like any div element to resize when the viewport size changes, so generally I could use e.g. flex or 10em
or %
- but actually I'd like it only to resize in increments of 30 pixels, so it'd always align with a background.
Is this possible?
The only way I could think of is defunct - it might have been possible with the mod
operator back in the day but not now?
Using modulus in css calc function
Also I could achieve this with media queries but to set that up for increments of only 30 pixels would be a nightmare.
The snippet below has a max-width of 210px and a min-width of 30px. As the browser resizes from wide to thin, it should jump in increments of 30px only.
.Mlt{
background-color:grey;
min-width:60px;
max-width:210px;
}
<div class="Mlt">
<p>Hello</p>
<p>Content</p>
</div>