I can make my images/divs responsive by using percentages.
How can I make the font-size responsive to different screen sizes?
I stumbled across this problem recently and I wrote a solution for it that suits my needs. Maybe you will find that you can incorporate it into your CSS as well.
github.com/wadim/responsive-font-size
Usage:
@import "responsive-font-size";
p {
@include responsive-font-size (
$min-font-size: 1.8em,
$max-font-size: 3.7em,
$min-screen-width: 640px,
$max-screen-width: 1200px,
$font-size-step: 0.3em /* optional parameter, default: 0.1em */
);
}
It basically says:
If you want it to change when you hit width milestones (e.g. 768px, 370px, etc.), then use a CSS3 media query. If you want it to be constantly changing, then you could use the same percentage, or em, technique as with the images/divs (i.e. target / context = result), but I would suggest media queries.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With