I've created a site using the Zurb Foundation 3 grid. Each page has a large h1.
CSS
body {font-size:100%}
/* Headers */
h1 { font-size:6.2em;font-weight:500; }
HTML
<div class="row">
<div class="twelve columns text-center">
<h1> LARGE HEADER TAGLINE </h1>
</div><!-- End Tagline -->
</div><!-- End Row -->
When I resize the browser to mobile size the large font doesn't adjust and causes the browser to include a horizontal scroll to accomodate for the large text.
I've noticed that on the Zurb Foundation 3 Typography example page, the headers adapt to the browser as it is compressed and expanded.
Am I missing something really obvious? How do I achieve this?
If you are using a build tool then try Rucksack.
Otherwise, you can use CSS Variables (Custom Properties) to easily control the min and max font sizes like so (demo):
There are several ways to achieve this
Use media query but requires font sizes for several breakpoints
Use dimensions in % or em. Just change the base font size everything will change. Unlike previous one you could just change the body font and not h1 everytime or let base font size to default of the device and rest all in em
see kyleschaeffer.com/....
CSS3 supports new dimensions that are relative to view port. But this doesn't work in android
3.2vmax = Bigger of 3.2vw or 3.2vh
see css-tricks.com/.... and also look at caniuse.com/....
Have find this solution, work very good for me.
As with many frameworks, once you "go off the grid" and override the framework's default CSS, things will start to break left and right. Frameworks are inherently rigid. If you were to use Zurb's default H1 style along with their default grid classes, then the web page should display properly on mobile (i.e., responsive).
However, it appears you want very large 6.2em headings, which means the text will have to shrink in order to fit inside a mobile display in portrait mode. Your best bet is to use a responsive text jQuery plugin such as FlowType and FitText. If you want something light-weight, then you can check out my Scalable Text jQuery plugin:
http://thdoan.github.io/scalable-text/
Sample usage:
If you don't mind to use a jQuery solution you can try TextFill plugin
https://github.com/jquery-textfill/jquery-textfill