Open In App

Foundation CSS Typography Helpers Typescale

Last Updated : 14 Mar, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

Foundation CSS is an open-source & responsive front-end framework built by ZURB foundation in September 2011, that makes it easy to design beautiful responsive websites, apps, and emails to look amazing & can be accessible to any device. It is used by many companies such as Facebook, eBay, Mozilla, Adobe, and even Disney. The framework is built on Saas-like bootstrap. 

Scaffolding certain typographic styles is faster using the foundation CSS helper classes. These CSS has multiple typography helpers such as Text Alignment, Subheader, Lead Paragraph, Unbulleted List, and Typescale. In this article, we will learn about the Typescale Typographic helper.

The Foundation CSS Typescale Typographic Helper is used to adjust the font size by overriding an element’s default size. This can be useful to size a <p> or <h1> through <h6> using Foundation’s existing header sizes. To override the default size of the element in Foundation CSS, we use the h1/h2/h3/h4/h5/h6 classes. 

Foundation CSS Typescale Typographic Helper Class:

  • h1/h2/h3/h4/h5/h6: These classes different font scale where h1 is largest and h6 is smallest.

Syntax:

<p class="h1/h2/h3/h4/h5/h6">Content</p>

Example 1: The following example demonstrates the Typescale typographic helper class in the <p> element.

HTML




<!DOCTYPE html>
<html lang="en">
  
<head>
    <!-- Compressed CSS -->
    <link rel="stylesheet" href=
  
    <!-- Compressed JavaScript -->
    <script src=
    </script>
    <script src=
    </script>
</head>
  
<body>
    <h1 style="color: green;">
        GeeksforGeeks
    </h1>
      
    <strong>
        Foundation CSS Typescale Typographic Helper
    </strong>
      
    <br /><br />
    <p class="h1">Paragraph element with h1 class</p>
  
    <p class="h2">Paragraph element with h2 class</p>
  
    <p class="h3">Paragraph element with h3 class</p>
  
    <p class="h4">Paragraph element with h4 class</p>
  
    <p class="h5">Paragraph element with h5 class</p>
  
    <p class="h6">Paragraph element with h6 class</p>
</body>
  
</html>


Output:

Output

Example 2: The following example demonstrates the Typescale typographic helper class in the <h1> through <h6> element and is used to override their default size.

HTML




<!DOCTYPE html>
<html lang="en">
  
<head>
    <!-- Compressed CSS -->
    <link rel="stylesheet" href=
  
    <!-- Compressed JavaScript -->
    <script src=
    </script>
    <script src=
    </script>
</head>
  
<body>
    <h1 style="color: green;">
        GeeksforGeeks
    </h1>
      
    <strong>
        Foundation CSS Typescale Typographic Helper
    </strong>
      
    <br/><br/>
    <h1 class="h6">h1 element with h6 class</h1>
    <h2 class="h5">h2 element with h5 class</h2>
    <h3 class="h4">h3 element with h4 class</h3>
    <h4 class="h3">h4 element with h3 class</h4>
    <h5 class="h2">h5 element with h2 class</h5>
    <h6 class="h1">h6 element with h1 class</h6>    
</body>
  
</html>


Output:

Output

Reference: https://get.foundation/sites/docs/typography-helpers.html#typescale



Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads