Imagine you have a div container:
.container { max-width: 95%; margin-right: auto; margin-left: auto; }
This creates a beautiful, fully responsive left and right margin proportional to the width of the browser screen, right?
For extra small and extra large screens, you can even add some @media requests to link them, so the content is always read:
@media (min-width: 450px) { .container { max-width: 100% // Remove the padding } } @ media (min-width: 1170px) { .container { max-width: 1170px // Prevent your content scaling to infinity } }
Now imagine that you wanted the same principles to apply to typography and font sizes.
Relative% font size with minimum and maximum values, proportional to the width of the screen. I'm not talking about a lot of unstable static @media queries (as they say, ahm BS3 relies), but a smooth transition, like the container above.
And I want to do this without javascript (boo! No lettering.js!). Any CSS3 gurus out there?
Answers to the card please.
source share