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?
jQuery "FitText" is probably the best responsive header solution. Check it out at Github: https://github.com/davatron5000/FitText.js
You can make font size responsive if define it in vw (viewport width). However not all browser support it. Solution is to use JS to change base font size depending on browser width and set all font sizes in %. Here is article describing how to make responsive fontsizes: http://wpsalt.com/responsive-font-size-in-wordpress-theme/
I am afraid there is no easy solution with regards to font resizing. You can change font-size using media query, but technically it will not resize smoothly. For an example, if you use:
Your font size will be 3em both for 300px and 200px width. But you need lower font-size for 200px width to make perfect responsive.
So, what is the real solution? There is only one way. You have to create a png (with transparent background) image containing your text. After that you can easily make your image responsive (ex: width:35%; height:28px). By this way your text will be fully responsive with all devices.
You can use viewport value instead of ems, pxs or pts.
from Css-tricks: http://css-tricks.com/viewport-sized-typography/
I use this CSS classes, make my text fluid on any screen size:
This is partly implemented in foundation 5.
in _type.scss they have two set of header variable
For medium up they generates sizes based on the first set of variables.
And for default-i.e small screens they use second set of variables to generates css.
you can use these variables and override in your custom scss file to set font sizes for respective screen sizes