Font scaling based on width of container

后端 未结 30 3080
面向向阳花
面向向阳花 2020-11-21 04:35

I\'m having a hard time getting my head around font scaling.

I currently have a website with a body font-size of 100%. 100% of what though? This seems t

30条回答
  •  面向向阳花
    2020-11-21 05:06

    You may be you looking for something like this:

    http://jsfiddle.net/sijav/dGsC9/4/
    http://fiddle.jshell.net/sijav/dGsC9/4/show/

    I have used flowtype, and it's working great (however it's JavaScript and not a pure CSS solution):

    $('body').flowtype({
        minFont: 10,
        maxFont: 40,
        minimum: 500,
        maximum: 1200,
        fontRatio: 70
    });
    

提交回复
热议问题