08-10-max-width-typography.html 1.2 KB

123456789101112131415161718192021222324252627
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Using the max-width media query for small-screen typography</title>
  6. <!-- Load Open Sans Condensed & Regular from Google Fonts -->
  7. <link href='http://fonts.googleapis.com/css?family=Open+Sans+Condensed:700|Open+Sans:700,400' rel='stylesheet' type='text/css'>
  8. <style>
  9. body {
  10. font-family: 'Open Sans', 'Helvetica Neue', Arial, sans-serif;
  11. line-height: 1.5;
  12. }
  13. @media only screen and (max-width: 37.5em) {
  14. h1,h2,h3,h4,h5,h6 {
  15. font-family: 'Open Sans Condensed', 'Arial Narrow', Arial, sans-serif;
  16. }
  17. }
  18. </style>
  19. </head>
  20. <body>
  21. <h1>This is a heading with a few words.</h1>
  22. <p>This is a paragraph with many many words. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolore laboriosam esse distinctio tenetur ad sapiente aliquid quas consectetur eos provident, doloribus a, eum harum obcaecati, tempore iste iusto cumque porro?</p>
  23. <p>Another paragraph with many many words. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolore laboriosam esse distinctio tenetur ad sapiente aliquid quas consectetur eos provident, doloribus a, eum harum obcaecati, tempore iste iusto cumque porro?</p>
  24. </body>
  25. </html>