Monday, February 9, 2015

Font-size property dynamically proportioned to the browser window size

It's called viewport. It's the same to say browser window size.
We can assign to the font-size property a value expressed in percentage.
For example if the viewport width is 50 cm, assinging a font-size of 1vw matches to 0.5 cm.
So we give it simply:
a {
    font-size: 1vw;
}

Others use of dinamical font-size use should be:
- the vh: viewport height - for example: font-size:1vh;
- the vmin: the smaller between vw or vh - for example: font-size:1vmin;
- the vmax: the larger between vw or vh - for example: font-size:1vmax;

Bye...

No comments:

Post a Comment