I use top: x
for align an item to center of the screen.
Exemple:
div {
top: 50%;
}
I would like a script when the screen size shrinks, to resize top: 50%
by a certain percentage for example 0.2
.
Exemple:
If screen size is 1920 x 1080 top: 50%;
If zoom or change device with a smaller one and screen size is 320 x 480 top: 45%;
Every time when screen get smaller then 1920 x 1080 top get a value with - 0.01%
Update
I use fittext.js and now it's work fine on every device at any screen resolution. It is a very useful plugin.